Dataframe中时间字符串转化问题

Dataframe中数据如下:
index timediff
2019-12-02 08:36:02 NaT
2019-12-02 08:36:04 0 days 00:00:02
2019-12-02 08:36:08 0 days 00:00:04
2019-12-02 08:36:10 0 days 00:00:02
2019-12-02 08:36:14 0 days 00:00:04
2019-12-02 15:54:29 0 days 00:00:06
2019-12-02 15:54:31 0 days 00:00:02
2019-12-02 15:54:41 0 days 00:00:10
2019-12-02 15:54:44 0 days 00:00:03
2019-12-02 15:54:50 0 days 00:00:06

将时间字符串转化为可运算时间:pd.to_datetime()
将timediff转化为秒:total_seconds()

上一篇:金三银四,忙着跳槽?别大意,弄清楚这12个细节,才不会被忽悠~


下一篇:Hyperledger Fabric 2.x 动态更新智能合约