I have a dataset which I attached a sample of it. My goal is to find the average time that it takes to finish each process. I use the following code:
import pandas as pd
df = pd.read_csv(....)
df['Start Time']=pd.to_datetime(df['Start Time'])
df['Finish Time']=pd.to_datetime(df['Finish Time'])
df['Process'] = df['Process'].astype("category")
df['Duration'] = df['Finish Time']-df['Start Time']
sectors = df.groupby('Process')
sectors['Duration'].mean()
However, whenever I run the code I get the following error:
No numeric types to aggregate
Any help would be appreciated.
File = https://filebin.net/0698p6q9or49ctw6/bb.csv?t=77zhetpd
PS: 1. Here is the result When I used dt.days:
A 0.5
B 0.0
C 0.0
But I am looking for sth like this:
Average A = 16.54305554 hours
Average B = 0.67 hours
Average C = 1.37 hours