Jun-07-2020, 10:13 AM
What are column types (date and time)?
If they are of DateTime dtype (datetime64[ns]), you can do this using groupby, e.g.
If they are of DateTime dtype (datetime64[ns]), you can do this using groupby, e.g.
df.groupby('date')['high'].max() # get max values of 'high' column for each day df.groupby('date')['high'].min() # get min values of 'high' column for each day df.groupby([df.date, df.time.dt.hour])['high'].max() # get max values of 'high' column for each hour (during the day)