subject

The Safe Harbor Method applies to "Geographic Subdivisions" as opposed to each zipcode itself.
Geographic Subdivision: All areas which share the first 3 digits of a zip code Count the total population for each geographic subdivision, storing the first 3 digits of the zip code and its corresponding population in the dictionary zip_dict. (For example, if there were 20 people whose zip code started with 090, the key-value pair in zip_dict would be {'090': 20}.)
Warning: you have to be savy with a dictionary here
To understand how a dictionary works, check the section materials, use google and go to discussion sections!
Instructions:
Create an empty dictionary: zip_dict = {}
Loop through all the zip_codes in df_zip
Create a dictionary key for the first 3 digits of a zip_code in zip_dict
Continually add population counts to the key that contains the same first 3 digits of the zip code
To extract the population you will find this code useful:

population = list(df_zip. loc[df_zip['zip']==zip_code]['popul ation'])

To extract the first 3 digits of a zip_code you will find this code useful:

int(str(zip code)[:3])
at-zıp df zip pd .read.

CSy('zip-pop . c sv ', dtype-t, zıp. : stry) =

zip population
0 01001 16769
1 01002 29049
2 01003 10372
3 01005 5079
4 01007 14649
5 01008 1263
6 01009 741
7 01010 3609
8 01011 1370
9 01012 661
10 01013 23188
11 01020 29668
12 01022 2451
13 01026 946
14 01027 17660
15 01028 15720
16 01029 789
17 01030 11669

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Kyle wants to access his school’s home page. how can he do this?
Answers: 1
question
Computers and Technology, 21.06.2019 23:30
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
question
Computers and Technology, 22.06.2019 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
The Safe Harbor Method applies to "Geographic Subdivisions" as opposed to each zipcode itself.
Questions
question
Mathematics, 04.03.2021 17:30
question
Mathematics, 04.03.2021 17:30
question
History, 04.03.2021 17:30
question
Mathematics, 04.03.2021 17:30
Questions on the website: 13722359