blog icon indicating copy to clipboard operation
blog copied to clipboard

error with pyfolio; AttributeError: 'Series' object has no attribute 'iteritems'

Open jaoujal opened this issue 6 months ago • 0 comments

hi, thank you for tis great work,

I got this error with pyfolio:


AttributeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_21596\3278245655.py in ?() 1 # get performance statistics for strategy ----> 2 pf.show_perf_stats(returns)

~\anaconda3\envs\FX\Lib\site-packages\pyfolio\plotting.py in ?(returns, factor_returns, positions, transactions, turnover_denom, live_start_date, bootstrap, header_rows) 644 APPROX_BDAYS_PER_MONTH) 645 perf_stats = pd.DataFrame(perf_stats_all, columns=['Backtest']) 646 647 for column in perf_stats.columns: --> 648 for stat, value in perf_stats[column].iteritems(): 649 if stat in STAT_FUNCS_PCT: 650 perf_stats.loc[stat, column] = str(np.round(value * 100, 651 1)) + '%'

~\anaconda3\envs\FX\Lib\site-packages\pandas\core\generic.py in ?(self, name) 6200 and name not in self._accessors 6201 and self._info_axis._can_hold_identifiers_and_holds_name(name) 6202 ): 6203 return self[name] -> 6204 return object.getattribute(self, name)

AttributeError: 'Series' object has no attribute 'iteritems'

jaoujal avatar Dec 03 '23 14:12 jaoujal