DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
pandas group by multiple columns and count
df.groupby(['col1', 'col2']).size() .sort_values(ascending=False) .reset_index(name='count')
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#pandas
#group
#multiple
#columns
#count
ADD COMMENT
Topic
COMMENT
Name
9+3 =
Submit