Sorting Array Without Sort Method Pandas Dataframe Group By Aggregate