Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我得到的数据表明时间格式包括一些时间超过 24 小时的行。
数据还包括日期参数
时间 26:00 表示次日 2:00
最长时间是 28:00
我想创建 datetime 参数,但因为 time 参数是一个对象,所以它不允许我使用它。当我尝试转换时,它说“小时必须在 0..23: 24:00:02”
有什么建议吗?
编辑:我需要日期时间
您可以使用 pandas 中的 to_timedelta 和 to_datetime。
df['date time'] = pd.to_datetime(df['date'], format='%d.%m.%y') + pd.to_timedelta(df['time'])