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

stats.py FutureWarning with DataFrame.prod #308

Closed
kartiksubbarao opened this issue Sep 22, 2023 · 1 comment
Closed

stats.py FutureWarning with DataFrame.prod #308

kartiksubbarao opened this issue Sep 22, 2023 · 1 comment

Comments

@kartiksubbarao
Copy link
Contributor

kartiksubbarao commented Sep 22, 2023

The following line in stats.py causes a FutureWarning in recent versions of Pandas (e.g. 2.1):

    return _np.product(1 + returns) ** (1 / len(returns)) - 1

This can be resolved by explicitly specifying axis=0:

    return _np.product(1 + returns, axis=0) ** (1 / len(returns)) - 1
kartiksubbarao added a commit to kartiksubbarao/quantstats that referenced this issue Sep 22, 2023
Fix FutureWarning with DataFrame.prod(), closes ranaroussi#308
@kartiksubbarao
Copy link
Contributor Author

This is superceded by #335

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.

1 participant