-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
  • 15
  • 4

1 Answers1

0

Try with

d = {x : y for x , y in df.groupby('col')}
BENY
  • 296,997
  • 19
  • 147
  • 204