I want to use groupby.agg where my group is the whole framework. In other words, I want to use agg functionality without groupby. I searched for an example of this, but cannot find it.
Here is what I did:
import pandas as pd import numpy as np np.random.seed([3,1415]) df = pd.DataFrame(np.random.rand(6, 4), columns=list('ABCD')) df

def describe(df): funcs = dict(Kurt=lambda x: x.kurt(), Skew='skew', Mean='mean', Std='std') one_group = [True for _ in df.index] funcs_for_all = {k: funcs for k in df.columns} return df.groupby(one_group).agg(funcs_for_all).iloc[0].unstack().T describe(df)

Question
How was I supposed to do this?
source share