I want to convert the AVG column's numbers to hour(s):minute(s) form.
- if it is more than 24h, I still want only hour:minutes form like this 73:45
- consider these numbers as seconds
plus I want to show the AVG time of these activities on a bar. All the activities. I us this for it:
df2 = df.groupby(['Activity']).mean()
I want to see the hour:minutes
df = pd.read_csv('practice.csv')
df['AVG'] = df['AVG'].astype('datetime64[ns]')
out:
Activity AVG 0 sleep 1970-01-01 00:00:00.000000221 1 sleep 1970-01-01 00:00:00.000000201 2 swim 1970-01-01 00:00:00.000000300 3 run 1970-01-01 00:00:00.000001768 4 tv 1970-01-01 00:00:00.000000105