-
-
Notifications
You must be signed in to change notification settings - Fork 858
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
UnsupportedFunctionCall #376
Comments
Same problem here... |
To fix the resampling issue in the quantstats library, locate the "core.py" file in the quantstats installation directory (usually found in your Python site-packages). Around line 292, replace the existing code with the following: if resample:
returns = returns.resample(resample)
returns = returns.last() if compound is True else returns.sum()
if isinstance(benchmark, _pd.Series):
benchmark = benchmark.resample(resample)
benchmark = benchmark.last() if compound is True else benchmark.sum() I haven't tested the entire repo, but when I call full() it works. :) |
It was issued by brunch in "Issues" #375. |
Still there are some issues as below For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. port["Weekly"].ffill(inplace=True) For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. port["Monthly"].ffill(inplace=True) For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. port["Quarterly"].ffill(inplace=True) For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. port["Yearly"].ffill(inplace=True) |
qs.reports.full(returns, mode='full', benchmark=benchmark)
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\quantstats\reports.py", line 628, in full
plots(
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\quantstats\reports.py", line 1346, in plots
_plots.daily_returns(
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\quantstats_plotting\wrappers.py", line 512, in daily_returns
fig = _core.plot_timeseries(
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\quantstats_plotting\core.py", line 294, in plot_timeseries
returns = returns.last() if compound is True else returns.sum(axis=0)
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\pandas\core\resample.py", line 1183, in sum
nv.validate_resampler_func("sum", args, kwargs)
File "C:\ProgramData\miniconda3\envs\bbsdev\lib\site-packages\pandas\compat\numpy\function.py", line 376, in validate_resampler_func
raise UnsupportedFunctionCall(
pandas.errors.UnsupportedFunctionCall: numpy operations are not valid with resample. Use .resample(...).sum() instead
The text was updated successfully, but these errors were encountered: