Question: You need to do the following data processing using df _ zip : Keep only 5 - digit zip codes in the contbr _ zip
You need to do the following data processing using dfzip :
Keep only digit zip codes in the contbrzip column.
if zip length is digit long and all are digits, zip has no change.
if zip is missing, assign it
if zip length is less than assign it as
if the length is longer than keep only the first digits only if first digits exist
After conversion, display:
the total number of rows,
the first zipcodes, and
last zipcodes
Hints:
work only on the dfzip
use dataframe or series
need to define function
mapapply this function to your data seriesdataframe
if you use a loop, it will be very slow.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
