I have Dataframe like:
age gender occupation zip_code
user_id
1 24 M technician 85711
2 53 F other 94043
3 23 M writer 32067
4 24 M technician 43537
5 33 F other 15213
6 42 M executive 98101
7 57 M administrator 91344
8 36 M administrator 05201
9 29 M student 01002
10 53 M lawyer 90703
I have to get Male ratio per occupation and sort it from the most to the least.
I tried this and after this not able to proceed:
users.groupby(['occupation','gender']).gender.count()