I have data as below.
Date percent
2021-02-01 22.8
2021-02-01 0.0
2021-02-02 5.5
2021-02-03 9.0
2021-02-04 70.2
2021-02-04 58.9
2021-02-06 33.2
2021-02-05 22.5
2021-02-08 12.3
2021-02-09 19.3
I want to group them in to every 10 %. Desired output is below:
Group count
<10 333
10-20 6
20-30 32
30-40 23
40-50 47
50-60 10
60-70 54
I've tried with the below code but it didn't give the format I wanted.
df.groupby('percent').count()
Can someone teach me how to make a group per 10 %?