Pandas sort one column by custom order and the other naturally
Consider the following code:
Sorting Groups by the Order they are in Excel
I basically want my before_X.groupy and after_X.groupby groups to be sorted by which ever str[:3] comes first in the excel sheet according to the row. Right now the groups that are further down are being printed first. I have a snippet of the code here: