原始数据Touch Time Install Time3/28/2019 14:06 3/28/2019 15:343/27/2019 19:23 3/28/2019 15:223/28/2019 15:01 3/28/2019 15:183/28/2019 12:41 3/28/2019 15:183/27/2019 12:10 3/28/2019 15:08在此之后,我使用 read_csv 读取了 csv 并创建了一个新的列差异df['diff'] = pd.to_datetime(df['Install Time']) - pd.to_datetime(df['Touch Time'])这会创建一个列差异: Touch Time Install Time diff0 3/28/2019 14:06 3/28/2019 15:34 0 days 01:28:001 3/27/2019 19:23 3/28/2019 15:22 0 days 19:59:002 3/28/2019 15:01 3/28/2019 15:18 0 days 00:17:003 3/28/2019 12:41 3/28/2019 15:18 0 days 02:37:004 3/27/2019 12:10 3/28/2019 15:08 1 days 02:58:00对于我的分析,我想将 diff 列中的值转换为小时,然后使用 matplotlib 绘制它。我希望最终数据如下所示:0 days 01:28:00 should reflect as 1 1 days 02:58:00 should reflect as 26
添加回答
举报
0/150
提交
取消