Answers for "how to sort variable in specifiic order in python"

0

how to sort variable in specifiic order in python

df.A=pd.Categorical(df.A,categories=['July', 'August', 'Sept'])
df=df.sort_values('A')
df
Out[310]: 
        A  B
1    July  3
0  August  2
2    Sept  6
Posted by: Guest on August-17-2021

Code answers related to "how to sort variable in specifiic order in python"

Python Answers by Framework

Browse Popular Code Answers by Language