You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have loaded data in via Blomberg api function for 2 assets and renamed the columns to Strategy and Benchmark. When i try and run the following code on the dataframe : qs.plots.snapshot(df, title='Performance', show=True)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have loaded data in via Blomberg api function for 2 assets and renamed the columns to Strategy and Benchmark. When i try and run the following code on the dataframe : qs.plots.snapshot(df, title='Performance', show=True)
I get the below error, any help welcome TIA
TypeError Traceback (most recent call last)
Cell In[34], line 1
----> 1 qs.plots.snapshot(df, title='Performance', show=True)
File ~\AppData\Local\anaconda3\Lib\site-packages\quantstats_plotting\wrappers.py:133, in snapshot(returns, grayscale, figsize, title, fontname, lw, mode, subtitle, savefig, show, log_scale, **kwargs)
128 if subtitle:
129 if isinstance(returns, _pd.Series):
130 axes[0].set_title(
131 "%s - %s ; Sharpe: %.2f \n"
132 % (
--> 133 returns.index.date[:1][0].strftime("%e %b '%y"),
134 returns.index.date[-1:][0].strftime("%e %b '%y"),
135 _stats.sharpe(returns),
136 ),
137 fontsize=12,
138 color="gray",
139 )
140 elif isinstance(returns, _pd.DataFrame):
141 axes[0].set_title(
142 "\n%s - %s ; "
143 % (
(...)
148 color="gray",
149 )
TypeError: 'method' object is not subscriptable
Beta Was this translation helpful? Give feedback.
All reactions