I have a pandas dataframe in the format below:
Timestamp Column1 Column2 Column3
2018-01-01 00:00:01 5.7 4.0 2.0
2018-01-01 00:00:02 5.7 4.2 1.8
2018-01-01 00:00:03 4.9 5.1 5.5
2018-01-01 00:00:04 5.8 5.2 1.9
and so on. Essentially have data in second level granularity. I am looking to summarize as follows:
Timestamp Column1 Column2 Column3
2018-01-01 00:00 5.8 5.2 5.5
Essentially for every minute, I want to calculate the max value. Any value occurring between say
2018-01-01 00:00:01 and 2018-01-01 00:00:59
needs to be included in the calculation and summarized as value for timestamp
2018-01-01 00:00:00
I have tried (assuming df is the name of the dataframe) and pandas loaded as pd
df=df.groupby(pd.Timestamp.floor(df['Timestamp'], freq='min')).max()
But this does not work. Thoughts? Thanks!