3

I need to find argmax index in pd.DataFrame. I want exacly the same result, as pandas.DataFrame.idxmax does, but this function returns index of first occurrence of maximum over requested axis. I want find index of last occurrence of maximum. Thank you in advance.

1 Answers1

4

Run df[::-1].idxmax()

The trick is to process rows in reversed order.

Valdi_Bo
  • 30,023
  • 4
  • 23
  • 41