Question: In python, In this part, you should write a for loop, updating the df_users dataframe. Go through each user, and update their zip-code (column name

In python, In this part, you should write a for loop, updating the df_users dataframe. Go through each user, and update their zip-code (column name zip), to Safe Harbour specifications:

  • If the user is from a zip code for the which the "Geographic Subdivision" is less than equal to 20000, change the zip code to 0
  • Otherwise, change the zip code to be only the first 3 numbers of the full zip cide
  • Do all this re-writting the zip_code columns of the df_users DataFrame

Hints: This will be several lines of code, looping through the DataFrame, getting each zip code, checking the geographic subdivision with the population in zip_dict, and settig the zip_code accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!