Answers for "groupby pandas mode"

1

how to find the mode using pandas groupby

source.groupby(['Country','City']).agg(lambda x:x.value_counts().index[0])
Posted by: Guest on June-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language