Calculate the ratio of male grouped by occupation
occupation_grouped = users.groupby('occupation')
# Get back a multiindex pandas' Series containing ratio
# for each gender in each occupation
gender_ratio = occupation_grouped.value_counts(normalize=True)
# we can then unpack the Series to get back a dataframe
# then get the Male column
gender_ratio.unpack()['M']