我有一个数据帧,它有一列字符串格式的时间,如下所示:
id playTime
12 1d 13h 23m
13 42d 22h 47m
14 7d 16h 31m
15 1h 26m 6s
16 9d 58m
我tried pd.to_datetime(df['playTime'], format='%j%H%M%S')
但它显示time data does not match format '%j%H%M%S' (match). In the end, I'd like to convert the
df['playTime']values to seconds.
我认为需要^{} 对于Timedelta和^{} :
你能试试这个吗:
相关问题 更多 >
编程相关推荐