I'm trying to run Pyfolio's pf.create_full_tear_sheet(df_returns)
function on my own set of returns data df_returns
(pandas dataframe) which looks like this:
However I'm getting the error:
TypeError: Addition/subtraction of integers and integer-arrays with DatetimeArray is no longer supported. Instead of adding/subtracting `n`, use `n * obj.freq`
I suspect the date format might be the problem, hence I checked the datatype:
In: df_returns['Date'].dtype
Out: dtype('<M8[ns]')
In: df_returns['% Returns'].dtype
Out: dtype('float64')
Could it be that I'm not specifying the benchmark data in pf.create_full_tear_sheet(df_returns)
that's causing the error too?