Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a sample of the .csv file. Can you please write a python script to do the following: 1. Skip rows with NA (in

image text in transcribed

This is a sample of the .csv file.

Can you please write a python script to do the following:

1. Skip rows with NA (in the "cases" column)

2. Change data types from strings to proper types: "biweek" to interger; "year" to interger; "cases" to interger; "pop" to float

3. Print the "loc" and "pop" (paste only the top 10 rows), either as list or a dictionary

biweek,year,loc,cases,pop1,1906,BALTIMORE,NA,526822.13652,1906,BALTIMORE,NA,526995.2463,1906,BALTIMORE,NA,527170.19814,1906,BALTIMORE,NA,527347.01365,1906,BALTIMORE,NA,527525.71346,1906,BALTIMORE,NA,527706.31837,1906,BALTIMORE,NA,527888.8498,1906,BALTIMORE,NA,528073.32649,1906,BALTIMORE,NA,528259.771210,1906,BALTIMORE,NA,528448.204411,1906,BALTIMORE,NA,528638.646812,1906,BALTIMORE,NA,528831.11913,1906,BALTIMORE,NA,529025.64214,1906,BALTIMORE,NA,529222.236615,1906,BALTIMORE,NA,529420.923616,1906,BALTIMORE,NA,529621.723817,1906,BALTIMORE,NA,529824.65818,1906,BALTIMORE,NA,530029.74719,1906,BALTIMORE,NA,530237.011720,1906,BALTIMORE,12,530446.472821,1906,BALTIMORE,14,530658.151322,1906,BALTIMORE,17,530872.067823,1906,BALTIMORE,12,531088.243224,1906,BALTIMORE,23,531306.698325,1906,BALTIMORE,24,531527.45426,1906,BALTIMORE,43,531750.5311,1907,BALTIMORE,62,531975.95022,1907,BALTIMORE,99,532203.73233,1907,BALTIMORE,129,532433.89834,1907,BALTIMORE,185,532666.46885,1907,BALTIMORE,229,532901.46486,1907,BALTIMORE,237,533138.9077,1907,BALTIMORE,222,533378.81638,1907,BALTIMORE,221,533621.21349,1907,BALTIMORE,219,533866.119310,1907,BALTIMORE,154,534113.554611,1907,BALTIMORE,110,534363.540212,1907,BALTIMORE,99,534616.09713,1907,BALTIMORE,86,534871.245714,1907,BALTIMORE,54,535129.007215,1907,BALTIMORE,30,535389.402216,1907,BALTIMORE,22,535652.451617,1907,BALTIMORE,12,535918.176218,1907,BALTIMORE,5,536186.596919,1907,BALTIMORE,5,536457.734420,1907,BALTIMORE,NA,536731.609521,1907,BALTIMORE,6,537008.24322,1907,BALTIMORE,5,537287.655923,1907,BALTIMORE,6,537569.868824,1907,BALTIMORE,63,537854.902725,1907,BALTIMORE,44,538142.778326,1907,BALTIMORE,23,538433.5164

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

Recommended Textbook for

Statistical Reasoning for Everyday Life

Authors: Jeff Bennett, Bill Briggs, Mario F. Triola

4th edition

978-0321817747, 321817745, 978-0321890139, 321890132, 321817621, 978-0321817624

More Books

Students also viewed these Chemistry questions