lmoments3 and scipy (again)

David Painter david at dpconsulting.co.nz
Tue Oct 13 19:05:33 EDT 2020


I'm aware there have been problems with previous versions of
lmoments3 working with scipy -- comb having been replaced in scipy. I
thought by using pip to install numpy, scipy, lmoments3 [whence distr] I
would get compatible latest versions. I'm using 32-bit Python 3.8.6. I've
verified scipy 1.5.2 and lmoments3 1.10.4 are present. But I still get a
traceback referring to attribute comb not being present in
module scipy.misc.
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:37:30) [MSC v.1927 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import numpy
>>> import scipy
>>> import lmoments3
>>> from lmoments3 import distr
>>> data = [135.2 ,130.1 ,117 ,109.3 ,92.1 ,91.4 ,83.1 ,80.5 ,74.7
,69.8,65.2,58.6,56.5,55.4,54.6,54.5,49.5,48.9,48.3,46.6]
>>> paras = distr.gpa.lmom_fit(data)
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    paras = distr.gpa.lmom_fit(data)
  File
"C:\Users\David\AppData\Local\Programs\Python\Python38-32\lib\site-packages\lmoments3\distr.py",
line 59, in lmom_fit
    lmom_ratios = lm.lmom_ratios(data, nmom=n_min)
  File
"C:\Users\David\AppData\Local\Programs\Python\Python38-32\lib\site-packages\lmoments3\__init__.py",
line 82, in lmom_ratios
    return _samlmusmall(data, nmom)
  File
"C:\Users\David\AppData\Local\Programs\Python\Python38-32\lib\site-packages\lmoments3\__init__.py",
line 159, in _samlmusmall
    l1 = np.sum(x) / sm.comb(n, 1, exact=True)
AttributeError: module 'scipy.misc' has no attribute 'comb'

What am I doing wrong?


More information about the Python-list mailing list