I had the same sort of issue for a general groupby commands. However I also applied a function in part of my groupby command which sorted it fine. I am not sure exactly what you are looking to group it by or the purpose, but my code was along the lines of:
df.groupby('column name').mean()['column 2 name']