Pandas: Get rows with max value of group
df.groupby('Sp').apply(lambda t: t[t.Count==t.Count.max()])
Via StackOverflow.
Pandas: Get rows with max value of group
df.groupby('Sp').apply(lambda t: t[t.Count==t.Count.max()])
Via StackOverflow.
Leave a comment