Skip to content
New issue

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

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

Already on GitHub? # to your account

FutureWarning: Errors & Unsupported Function in Pandas #399

Open
rriggin opened this issue Dec 28, 2024 · 3 comments
Open

FutureWarning: Errors & Unsupported Function in Pandas #399

rriggin opened this issue Dec 28, 2024 · 3 comments

Comments

@rriggin
Copy link

rriggin commented Dec 28, 2024

I'm getting the following errors

 FutureWarning: Passing additional kwargs to DatetimeIndexResampler.sum has no impact on the result and is deprecated. This will raise a TypeError in a future version of pandas.

  pandas.errors.UnsupportedFunctionCall: numpy operations are not valid with resample. Use .resample(...).sum() instead

When I try to run this code:

import quantstats as qs

qs.extend_pandas()

stock = qs.utils.download_returns('GLD')

qs.reports.html(stock, title='GLD Report', output='output/gld_report.html')

qs.reports.html(stock, "ASML", title='GLD vs ASML Report', output='output/asml_vs_gld.html')

Full Error String

CleanShot 2024-12-28 at 16 12 50@2x

@renanmoretto
Copy link

same here

@emonares
Copy link

I got the same error, couldn't fina a solution...

@Jerem7401
Copy link

same error for me,

What I have tried so far:

pip install quantstats --upgrade

returns = returns.resample(resample).last() if compound is True else returns.resample(resample).sum()
Modified core.py (line 294) as suggested

pip install numpy==1.24.4 pandas==1.3.5
Downgrade

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants