I am hitting on a corner case in pandas. I am trying to use the agg fn but without doing a groupby. Say I want an aggregation on the entire dataframe
, i.e.
from pandas import *
DF = DataFrame( randn(5,3), index = list( "ABCDE"), columns = list("abc") )
DF.groupby([]).agg({'a' : np.sum, 'b' : np.mean } ) # <--- does not work
And DF.agg( {'a' ... } )
does not work either.
My workaround is to do DF['Total'] = 'Total'
then do a DF.groupby(['Total'])
but this seems a bit artificial.
Has anyone got a cleaner solution?