Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to sort dataframe in python by length of groups

df.groupby('col1').size().sort_values(ascending=False)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #dataframe #python #length #groups
ADD COMMENT
Topic
Name
7+5 =