Make Numpy Array From Pandas Dataframe Group By Average Sql