quantstats
quantstats copied to clipboard
Error with Report.full output
TypeError Traceback (most recent call last)
3 frames /usr/local/lib/python3.6/dist-packages/quantstats/reports.py in full(returns, benchmark, rf, grayscale, figsize, display, compounded) 248 249 plots(returns=returns, benchmark=benchmark, --> 250 grayscale=grayscale, figsize=figsize, mode='full') 251 252
/usr/local/lib/python3.6/dist-packages/quantstats/reports.py in plots(returns, benchmark, grayscale, figsize, mode, compounded, rolling_period) 518 grayscale=grayscale, 519 figsize=(figsize[0], figsize[0]*.5), --> 520 show=True, ylabel=False) 521 522 _plots.histogram(returns, grayscale=grayscale,
/usr/local/lib/python3.6/dist-packages/quantstats/_plotting/wrappers.py in yearly_returns(returns, benchmark, fontname, grayscale, hlw, hlcolor, hllabel, match_volatility, log_scale, figsize, ylabel, subtitle, compounded, savefig, show) 379 ylabel=ylabel, 380 subtitle=subtitle, --> 381 savefig=savefig, show=show) 382 if not show: 383 return fig
/usr/local/lib/python3.6/dist-packages/quantstats/_plotting/core.py in plot_returns_bars(returns, benchmark, returns_label, hline, hlw, hlcolor, hllabel, resample, title, match_volatility, log_scale, figsize, grayscale, fontname, ylabel, subtitle, savefig, show) 109 if subtitle: 110 ax.set_title("\n%s - %s " % ( --> 111 df.index.date[:1][0].strftime('%Y'), 112 df.index.date[-1:][0].strftime('%Y') 113 ), fontsize=12, color='gray')
TypeError: 'method' object is not subscriptable
I have the same issue. the Html report as well is broken. Is there any intermediary solution? Thanks.
AE
At my place I can approve it. Even with:
%matplotlib inline
import quantstats as qs
stock = qs.utils.download_returns('FB')
qs.reports.full(stock)
I am getting:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/workspaces/DeepRLValueTrading/backtesting/visualize.py in
54 stock = qs.utils.download_returns('FB')
----> 55 qs.reports.full(stock)
/usr/local/lib/python3.6/site-packages/quantstats/reports.py in full(returns, benchmark, rf, grayscale, figsize, display, compounded)
248
249 plots(returns=returns, benchmark=benchmark,
--> 250 grayscale=grayscale, figsize=figsize, mode='full')
251
252
/usr/local/lib/python3.6/site-packages/quantstats/reports.py in plots(returns, benchmark, grayscale, figsize, mode, compounded, rolling_period)
518 grayscale=grayscale,
519 figsize=(figsize[0], figsize[0]*.5),
--> 520 show=True, ylabel=False)
521
522 _plots.histogram(returns, grayscale=grayscale,
/usr/local/lib/python3.6/site-packages/quantstats/_plotting/wrappers.py in yearly_returns(returns, benchmark, fontname, grayscale, hlw, hlcolor, hllabel, match_volatility, log_scale, figsize, ylabel, subtitle, compounded, savefig, show)
379 ylabel=ylabel,
380 subtitle=subtitle,
--> 381 savefig=savefig, show=show)
382 if not show:
383 return fig
/usr/local/lib/python3.6/site-packages/quantstats/_plotting/core.py in plot_returns_bars(returns, benchmark, returns_label, hline, hlw, hlcolor, hllabel, resample, title, match_volatility, log_scale, figsize, grayscale, fontname, ylabel, subtitle, savefig, show)
109 if subtitle:
110 ax.set_title("\n%s - %s " % (
--> 111 df.index.date[:1][0].strftime('%Y'),
112 df.index.date[-1:][0].strftime('%Y')
113 ), fontsize=12, color='gray')
TypeError: 'method' object is not subscriptable
So it does not depend on our dataframes.
For debugging here are the verions of my installed packages.
python: 3.6.13 quantstats 0.0.26
QS dependencies seaborn 0.11.0 yfinance 0.1.55 matplotlib 3.3.3 tabulate 0.8.7 scipy 1.5.4 pandas 1.1.4 numpy 1.19.4
Hoping that this could help :-)
Same issue. Anyone find a workaround?
Same here
I have the exact same issue as well
tried downgrading, still the same issue