Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'numpy' has no attribute 'product' #365

Open
justin8shan opened this issue Sep 21, 2024 · 2 comments · May be fixed by #368
Open

AttributeError: module 'numpy' has no attribute 'product' #365

justin8shan opened this issue Sep 21, 2024 · 2 comments · May be fixed by #368

Comments

@justin8shan
Copy link

numpy only has function as of np.prod instead of np.product
Which version of numpy is np.product available in?

@i-am-garden
Copy link

I had a same issue. Just change line 96 in "stats.py"
return _np.product(1 + returns) ** (1 / len(returns)) - 1
-> return _np.prod(1 + returns) ** (1 / len(returns)) - 1

then It'll work again.

@antoniouaa
Copy link

numpy.product was deprecated in numpy 1.25, with this PR and removed in numpy 2.x.
This should be a quick and simple find all and replace, since np.prod has been around since at least numpy 1.7 and the requirements for this package ask for:

numpy>=1.16.5

@antoniouaa antoniouaa linked a pull request Oct 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants