Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sort df by column

df.rename(columns={1:'month'},inplace=True)
df['month'] = pd.Categorical(df['month'],categories=['December','November','October','September','August','July','June','May','April','March','February','January'],ordered=True)
df = df.sort_values('month',ascending=False)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #df #column
ADD COMMENT
Topic
Name
6+6 =