DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
6+6 =
Submit