我有了時間的列字符串格式如下一個熊貓數據幀:如何將字符串數據以可變格式轉換爲datetime?
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.
你的問題沒有意義,你有什麼是持續時間的集合,這裏沒有什麼可以指示一個日期。例如,第一行代表什麼? – EdChum