I am new to Python. I have started to use pyfolio library and when I typed the following code
pf.create_returns_tear_sheet(data['New_Adjusted_Returns'],benchmark_rets=None)
An error named occurred as follow:
AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime'
data['New_Adjusted_Returns'] consists of the following data:
Date
2020-02-14 -0.004500
2020-02-17 -0.022107
2020-02-18 -0.000029
2020-02-19 -0.000800
2020-02-20 -0.017102
2020-02-21 -0.000028
2020-02-24 0.014400
2020-02-25 0.007900
2020-02-26 -0.001000
2020-02-27 -0.000517
2020-02-28 -0.000029
Would someone be able to help me on this issue? Thank you very much.
fixed this by changing line 893 in file timeseries.py
valley = underwater.index[np.argmin(underwater)] # end of the period
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With