Let's say I have the following data frame
a b
0 aaa 123
1 bbb 345
2 ccc 678
3 aaa 91011
4 ccc 111213
5 bbb 131415
What I want is to group by the different values of column a
,
so I execute gb = df.groupby('a')
and now my dataframe is:
a b
0 aaa 123
1 aaa 91011
2 bbb 345
3 bbb 131415
2 ccc 678
4 ccc 111213
In the end, I want to have 3 data frames with different values.
For example, the first data frame will be
a b
0 aaa 123
1 aaa 91011
Any ideas?
Also, how to perform when I have thousands of values in column a
?