Python - Pandas - dtype 的时间总和:datetime64[ns]

时间:2021-03-16 12:29:20

标签: datetime64

我想在我的熊猫数据帧系列中添加时间:

例如 0 1899-12-30 00:53:00 1 1899-12-30 00:30:00 2 1899-12-30 01:16:00 3 1899-12-30 00:00:00 4 1899-12-30 00:15:00

日期无关紧要,我想总结一下时间部分。

我尝试了以下操作,但仍然不允许我总结时间:

base_job_ses['TimeWorked1'] = base_job_ses['TimeWorked1'].dt.time

base_job_ses['TimeWorked1'].sum()

TypeError: cannot perform sum with type datetime64[ns]

0 个答案:

没有答案