How to to convert object string data from the csv column into total seconds.
In my csv sheet, data looks like below,
Duration
1hr 5m
2 hr 10m
Example: 1m -> 60s ( I would like to convert like this). But I am getting below error,
TypeError: unsupported type for timedelta days component: Series
I think we can use the
pandas.to_timedelta()
to convert your strings to timedelta objects and then apply a lambda function to get the total seconds in the duration: