1

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

in the end, I want to have 3 data frames with different values.

For example, the first dataframe will be

   a    b 
0 aaa  123
1 aaa  91011
  

Any ideas?

Also, how to perform when I have thousand of rows and I don't know exactly the different values of a column a?

anky
  • 74,114
  • 11
  • 41
  • 70
loutsi1
  • 25
  • 5
  • 3
    groupby and convert to a dictionary: `d = dict([*df.groupby("a")])`, then grab the keys to get the values – anky May 20 '21 at 15:09

0 Answers0