I have a large dataframe which is similar like this:
id price status
1 23 none
2 23 none
3 34 none
4 32 none
5 31 none
6 37 none
7 20 none
8 29 none
9 21 none
10 22 done
and I want to make a groupby based on the status. I want to make a group where the situation like this: every time the status is done, it will be one group.
So far, what I have done is making a group based on the index:
grouper = df.groupby(df.index // 10)
but then I realize that the status is written done randomly and not always every 10 rows.
How can I make it in python? Thankyou