-1

I have the df like this:

1   a   12
2   a   3
3   b   45
4   b   34
5   b   23

and I need to split it to two df like this:

1   a   12
2   a   3

and

3   b   45
4   b   34
5   b   23

Someone know any reasonable quick way?

pd13
  • 13
  • 1
  • 5

1 Answers1

0

Try with

d = {x : y for x , y in df.groupby('col')}
BENY
  • 317,841
  • 20
  • 164
  • 234