I\'ve frequented used pandas\' agg() function to run summary statistics on every column of a data.frame. For example, here\'s how you would produce the mean an
agg()
Panda's 0.19.1 doc says "groupby preserves the order of rows within each group", so this is guaranteed behavior.
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html