当我看到数据类型时,它似乎是object,但我无法将其转换为datetime64
0 2017-11-29 17:14:00
1 2017-02-15 15:35:00
2 2018-10-18 08:02:00
3 2017-06-22 09:25:00
4 2017-09-21 11:12:00
Name: Data e Hora Indução Anestesica, dtype: object
我已经试过了,但不起作用
df['Data e Hora Indução Anestesica'].astype(str).astype(int)
hg = df['Data e Hora Indução Anestesica'].astype(str).str.zfill(6)
df['Data e Hora Indução Anestesica'] = pd.to_datetime(hg, format='%Y/%m/%d%H%M%S')
就这么做吧
相关问题 更多 >
编程相关推荐