Convert hh:mm:ss to minutes using python pandas

pandas, python

Solution

You could try to convert it to `DatetimeIndex`

In [58]: time = pd.DatetimeIndex(df['time taken'])

In [59]: time.hour * 60 + time.minute
Out[59]: array([128, 125, 175, 222,  72, 106, 202, 216], dtype=int32)

Problem

I have a dataframe column, `data['time taken']` ; ``` 02:08:00 02:05:00 02:55:00 03:42:00 01:12:00 01:46:00 03:22:00 03:36:00 ``` How do I get the output in the form of minutes like below? ``` 128 125 175 222 72 106 202 216 ```

Original source