79298460

Date: 2024-12-20 21:47:56
Score: 0.5
Natty:
Report link

You can slice the dataframe by using the informatioa from GroupBy:

g = df.groupby("SN")["Amount"].max()
df = df.loc[df["SN"].isin(g.index) & df["Amount"].isin(g.values)].reset_index(drop=True)
display(df)

    SN  Category    Amount
0   1   Cat2        3000
1   2   Cat22       5000
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: rehaqds