I want to calculate the average temperature per day within an specific time frame, for example average temperature on the date = 2021-03-11 between time = 14:23:00 and 16:53:00. I tried with a pivot_table the following:
in_range_df = pd.pivot_table(df, values=['Air_temp'],
index=['Date','Time'],
aggfunc={'Air_temp':np.mean})
The dataframe looks like this:
But how can I specify the time range now? Any help is appreciated.