Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- selected_countries = list(nations_count.index[:-1])
- country_genderdf = data[data.country.isin(selected_countries)][['country','gender']]
- # we make a cross tabulation of the countries and gender.
- country_genderdf = pd.crosstab(country_genderdf.country,
- country_genderdf.gender)
- country_genderdf.head() # print the first five rows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement