【发布时间】:2020-05-27 22:10:14
【问题描述】:
我正在尝试将日期时间索引转换为日期时间序列,但出现错误:
ticks = pd.date_range(start = '2019-12-30', end = '2020-02-11', periods = 6)
ticks.to_datetime()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-79-f41607e594d5> in <module>
----> 1 ticks.to_datetime(dayfirst=False)
AttributeError: 'DatetimeIndex' object has no attribute 'to_datetime'
为什么以及我应该怎么做?
【问题讨论】:
标签: python-3.x pandas datetime indexing