Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def population_for_country_in_year(country, year):
- """Optional: Define a function to return the population
- of a country in a year using a row from the poverty table."""
- geo = countries.where("name", are.equal_to(country)).column(0).item(0)
- country_pop = population.where("geo", are.equal_to(geo))
- country_pop_in_year = country_pop.where("time", are.equal_to(year)).column(2).item(0)
- return country_pop_in_year
- def poverty_for_country_in_year(country, year)
- geo = countries.where("name", are.equal_to(country)).column(0).item(0)
- country_poverty = poverty.where("geo", are.equal_to(geo))
- country_poverty_in_year = country_poverty.where("time", are.equal_to(year)).column(2).item(0)
- return country_poverty_in_year
- def population_living_in_poverty
- """Poverty Percent * Population of Country in Year"""
- return population_for_country_in_year(country, year)*poverty_for_country_in_year(country,year)
- def poverty_timeline(country):
- """Draw a timeline of people living in extreme poverty in a country."""
- geo = countries.where("name", are.equal_to(country)).column(0).item(0)
- country_poverty = poverty.where("geo", are.equal_to(geo))
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement