AttributeError:“ numpy.int64”对象没有属性“ to_pydatetime”

问题描述

我是Python的新手。我已经开始使用pyfolio库,并且在键入以下代码后

pf.create_returns_tear_sheet(data['New_Adjusted_Returns'],benchmark_rets=None)

发生一个名为的错误,如下所示:

AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime'

data ['New_Adjusted_Returns']由以下数据组成:

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.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)