简体   繁体   English

Python错误“ AttributeError:模块'scipy.misc'没有属性'logsumexp'”

[英]Python error “AttributeError: module 'scipy.misc' has no attribute 'logsumexp' ”

I'm trying to use the lifetimes header to create the Recency, Frequency and T from a given data but it keeps showing the following error AttributeError: module 'scipy.misc' has no attribute 'logsumexp' 我正在尝试使用lifetimes标头从给定数据创建新近度,频率和T,但它始终显示以下错误AttributeError:模块'scipy.misc'没有属性'logsumexp'

from lifetimes.plotting import *
from lifetimes.utils import *
from lifetimes.estimation import *
data = summary_data_from_transaction_data(df, 'CustomerID','InvoiceDate', monetary_value_col='Sales', observation_period_end='2011-12-9')
print(data.head())

The following output is received: 收到以下输出:

Traceback (most recent call last):
File "prj2.py", line 23, in <module>
from lifetimes.plotting import *
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lifetimes\__init__.py", line 5, in <module>
from .fitters.beta_geo_fitter import BetaGeoFitter
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lifetimes\fitters\beta_geo_fitter.py", line 9, in <module>
from autograd.scipy.special import gammaln, beta, gamma
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\autograd\scipy\__init__.py", line 7, in <module>
from . import misc
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\autograd\scipy\misc.py", line 7, in <module>
logsumexp = primitive(scipy.misc.logsumexp)
AttributeError: module 'scipy.misc' has no attribute 'logsumexp'

The version of SciPy is 1.3.0 The code should generate a table with Recency, Frequency and T of each Customer SciPy的版本为1.3.0。代码应生成一个包含每个客户的新近度,频率和T的表

降级为scipy == 1.1.0解决了该问题

from scipy.misc import logsumexp更改为from scipy.special import logsumexp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复“-scipy.misc 没有属性“imresize”” - How to fix "-scipy.misc has no attribute "imresize"" 我的scipy.misc模块似乎缺少了imsave - My scipy.misc module appears to be missing imsave Python AttributeError:模块没有属性 - Python AttributeError: module has no attribute 如何修复 python 中的“AttributeError: module 'pycocotools' has no attribute 'mask'”错误 - How to fix "AttributeError: module 'pycocotools' has no attribute 'mask'" error in python Python 错误“AttributeError 模块‘string’没有属性‘lstrip’” - Python error "AttributeError module 'string' has no attribute 'lstrip' " Python 3.7 错误:AttributeError:模块“子进程”没有属性“运行” - Python 3.7 Error: AttributeError: module 'subprocess' has no attribute 'run' Python3 错误:AttributeError:模块 'urllib' 没有属性 'request' - Python3 error : AttributeError: module 'urllib' has no attribute 'request' AttributeError: 模块 &#39;scipy.stats&#39; 没有属性 &#39;signaltonoise&#39; - AttributeError: module 'scipy.stats' has no attribute 'signaltonoise' python AttributeError:模块“袜子”没有属性“ setdefaultproxy” - python AttributeError: module 'socks' has no attribute 'setdefaultproxy' Python AttributeError:模块“字符串”没有属性“maketrans” - Python AttributeError: module 'string' has no attribute 'maketrans'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM