当前位置: 代码迷 >> 综合 >> Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got...
  详细解决方案

Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got...

热度:91   发布时间:2023-12-18 05:41:20.0

该error是resample所触发的,主要是resample(重采样)的索引需要是datetime格式的,所以只需在resample之前加一行。

data.index = pd.to_datetime(data.index)
  相关解决方案