I would like to convert a column from a large dataset that has the value of time as an object to an integer.
I would like to convert "Duration", "Talk Time" to int so I can perform some basic math such as the mean, the maximum and the minimum time recorded in the dataset.
Duration | Talk Time | |
---|---|---|
0 | 00:00:27 | 00:00:26 |
1 | 00:00:58 | 00:00:58 |
2 | 00:00:48 | 00:00:46 |
3 | 00:00:38 | 00:00:38 |
4 | 00:00:11 | 00:00:11 |
df['Duration'].astype(np.int64)
I get the error:
ValueError: invalid literal for int() with base 10: '00:00:27'