pandas how to assign column name when aggregate same column -


following command returns df contains 'website_id' , 'ctr':'var' 2 column. how can return df contains 4 columns appropriate column name?

df.groupby(['website_id']).agg({'ctr':'count','ctr':'mean', 'ctr':'var'} 

it easier work sample df , expected output think need

df.groupby(['website_id']).agg(['count','mean', 'var']) 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -