Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find the mode using pandas groupby

source.groupby(['Country','City']).agg(lambda x:x.value_counts().index[0])
 
PREVIOUS NEXT
Tagged: #find #mode #pandas #groupby
ADD COMMENT
Topic
Name
6+6 =