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()