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 #8

Closed
kartiksubbarao opened this issue Feb 6, 2024 · 0 comments · Fixed by #9
Closed

stats.py FutureWarning with DataFrame.prod #8

kartiksubbarao opened this issue Feb 6, 2024 · 0 comments · Fixed by #9

Comments

@kartiksubbarao
Copy link
Contributor

[copied from https://github.com/ranaroussi/quantstats/issues/308]

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
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