Skip to content
Advertisement

Pandas: Resample dataframe column, get discrete feature that corresponds to max value

Sample data:

JavaScript

gives:

JavaScript

I want to resample by ‘2D’ and get the max value, something like:

JavaScript

The expected result should be:

JavaScript

Can anyone help me?

Advertisement

Answer

You can resample to get the arg max of value and then use it to extract names and value

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement