I have dataframe named
I want to sort data frame month column according to month (Jan, Feb, March..).
For that I used code:
sorted_df = df1.sort_values(by='month') print(sorted_df)
but the output is sorted by alphabetic order of month column.
I think the reason for that in this month column data type is object so month column is sorted by alphabetic order.
The question is: how sort values in column month in correct order (according to order of months in year)?