Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use phyton Part 2 For the next set of questions, we will be using census data from the United States Census Bureau. Counties are political

use phyton image text in transcribed
Part 2 For the next set of questions, we will be using census data from the United States Census Bureau. Counties are political and geographic subdivisions of states in the United States. This dataset contains population data for counties and states in the US from 2010 to 2015. See this document for a description of the variable names. The census dataset (census.csv) should be loaded as census df. Answer questions using this as appropriate. Task 5 Which state has the most counties in it? (hint: consider the sumlevel key carefully! You'll need this for future questions too...) This function should return a single string value. Task 6 Only looking at the three most populous counties for each state, what are the three most populous states in order of highest population to lowest population)? Use CENSUS2010 POP. This function should return a list of string values. Task 7 Which county has had the largest absolute change in population within the period 2010-2015? (Hint: population values are stored in columns POPESTIMATE2010 through POPESTIMATE2015, you need to consider all six columns.) e.g. If County Population in the 5 year period is 100, 120, 80, 105, 100, 130, then its largest change in the period would be 130-80 = 50. This function should return a single string value. Task 8 In this datafile, the United States is broken up into four regions using the "REGION" column. Create a query that finds the counties that belong to regions 1 or 2, whose name starts with 'Washington', and whose POPESTIMATE2015 was greater than their POPESTIMATE 2014. This function should return a 5x2 DataFrame with the columns = ('STNAME', 'CTYNAME") and the same index ID as the census_df (sorted ascending by index). Part 2 For the next set of questions, we will be using census data from the United States Census Bureau. Counties are political and geographic subdivisions of states in the United States. This dataset contains population data for counties and states in the US from 2010 to 2015. See this document for a description of the variable names. The census dataset (census.csv) should be loaded as census df. Answer questions using this as appropriate. Task 5 Which state has the most counties in it? (hint: consider the sumlevel key carefully! You'll need this for future questions too...) This function should return a single string value. Task 6 Only looking at the three most populous counties for each state, what are the three most populous states in order of highest population to lowest population)? Use CENSUS2010 POP. This function should return a list of string values. Task 7 Which county has had the largest absolute change in population within the period 2010-2015? (Hint: population values are stored in columns POPESTIMATE2010 through POPESTIMATE2015, you need to consider all six columns.) e.g. If County Population in the 5 year period is 100, 120, 80, 105, 100, 130, then its largest change in the period would be 130-80 = 50. This function should return a single string value. Task 8 In this datafile, the United States is broken up into four regions using the "REGION" column. Create a query that finds the counties that belong to regions 1 or 2, whose name starts with 'Washington', and whose POPESTIMATE2015 was greater than their POPESTIMATE 2014. This function should return a 5x2 DataFrame with the columns = ('STNAME', 'CTYNAME") and the same index ID as the census_df (sorted ascending by index)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions