I generate for each week as csv file. The weeks are then merged into one. The merged CSV with the Dataframe looks like this:
machineId | id | mean | min | max
machine1 | 2 | 00:00:03.47 | 00:00:00.02 | 00:00:06.11
machine1 | 1 | 00:00:01.30 | 00:00:00.74 | 00:00:01.86
machine1 | 2 | 00:00:00.35 | 00:00:00.01 | 00:00:00.99
machine1 | 2 | 00:00:01.63 | 00:00:00.67 | 00:00:02.60
machine1 | 3 | 00:00:00.66 | 00:00:00.03 | 00:00:01.91
Then i want to group by the same rows and calculate the mean from the row. The first, thirt and fourth should be grouped by and the average of the columns should be calculated
I already used this method:
df = df.groupby(['machineId','id']).agg({'mean': 'mean','min':'mean','max':'mean})
but there is an error:
TypeError: Could not convert 00:00:03.47 to numeric