Question: Trusted Python 3 O Q Run Code Memory: 2 7 9 / 2 0 4 8 MB Question 3 c In question 3 a we

Trusted Python 3 O Q Run Code Memory: 279/2048 MB Question 3c In question 3a we noticed a large number of potentially invalid ZIP codes (e.g."CA"). These are likely due to data entry errors. To get a better understanding of the potential errors in the zip codes we will: 1. Import a list of valid San Francisco ZIP codes by using pd. read_json to load the file data/st_zipcodes.json and extract a series of type str containing the valid ZIP codes. Hint: set dtype when invoking read_Json. 2. Construct a DataFrame containing only the businesses which DO NOT have valid ZIP codes. You will probably want to use the series.isin function, Step 1 In [45]: valid_zip - pd. read_json(dsDirl'sf_zipcodes.json'.dtype-str) valid zips-valid_zipt"zip_codes").str.extract('{\d(5))', expand-False) valid_zips.head (20) Out[45]94102194103294104394105494107594108694109794110 B 941119941121094114119411512941161394117149411815941191694120179412118941221994123 Name: zip_codes, dtyper object Control P Help + N Run Code In [45]: valid_zip - pd. read 3son(dsDirl'sf_zipcodes.json',dtype={tr}) valid_zips-valid_zipl"zip_codes").str.extract("(\d(5))", expand-False) valid_zips.head (20) Python Memory: 279/204 Out [45]: 0941021941032941043941054941075941086941097941108941119941121094114119411512941161394117149411815941191694120179412118941221994123 Name: zip codes, dtyper object In [46]: grader.check("q3ci") Out[46): All tests passed! Step 2 In []: invalid_zip_bus- invalid_zip_bus.head(10) In () grader.check ("q3cii")

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 Programming Questions!