neuniversity / ALY6140

1 stars 3 forks source link

Groupby method function #52

Open cloverpyy opened 5 years ago

cloverpyy commented 5 years ago

the .groupby() function only just choose the one column and order by it, if I want to groupby 2 columns, what functions should I use for it. Thanks for your help.

ThatkidfromA commented 5 years ago

Hi, You can do it by 'grouped = df.groupby(['A', 'B'])'

Check this website:http://pandas.pydata.org/pandas-docs/stable/groupby.html

It has a good documentation