Sorting the data in table using Jupyter


I try to call a dataset of flights that reads from a .csv file.

But, when I run like:

It is confused among months why it happened and how to solve this problem. I want to sort the data in this table in order of months: January, February,…December.

Any help would be much appreciated. Thanks
Van Can

dear vancan.

thank you for your posting.
Sorting of pandas pivod_table is sorted in numerical order or in alphabetical order.
Therefore, although it takes more work, it is better to operate flight_df as follows.

new_order = [‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’ ]

df1 = flight_df.reindex(new_order, axis=0)

In addition, since the index of month is the condition at the beginning, it is better to check the Dataframe first.

regards, you.

Thank you for your help.

Van Can