『开发技术』解决TypeError: Cannot cast Index to dtype M8[D] 小宋是呢 2021-08-25 213 阅读1分钟 原代码 df.columns = df.columns.astype('M8[D]') 修改为 df.columns = df.columns.astype('M8[ns]')