0

I have a dataframe like this:


_id username    following   followers   private verified
1   1294010398878859266 BL  1303.0  1312.0  False   False
2   1526152323478740994 Ju  2910.0  2370.0  False   False
3   1215931021767725056 kdr 60.0    39.0    False   False
4   840814070160842753  smim    12791.0 13618.0 False   False
5   1557105403175047168 _blium_ 442.0   253.0   False   False

And in this dataframe there are multiple rows for each username with different values in followers column. I want to group this dataframe based on username and for each username I want to have the row with maximum value in followers column. But I definitely want to have the entire columns of the dataframe in the output. I've seen some questions in stackoverflow.com like this question. But they are a little bit different. For example the aggregate function is sum. Please don't close my question, because I need the answer. Thank.

HosseinSedghian
  • 383
  • 2
  • 15

0 Answers0