Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. selected_countries = list(nations_count.index[:-1])
  2.  
  3. country_genderdf = data[data.country.isin(selected_countries)][['country','gender']]
  4.  
  5. # we make a cross tabulation of the countries and gender.
  6. country_genderdf = pd.crosstab(country_genderdf.country,
  7. country_genderdf.gender)
  8.  
  9. country_genderdf.head() # print the first five rows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement