Question: The language is Python 3.6 Thanks! >>> print(raw_data) ([[4, 17, 67, 76, 51, 28, 3, 1, 0, 0, 0, 1], [0, 1, 8, 28, 69,

The language is Python 3.6

Thanks!The language is Python 3.6 Thanks!>>> print(raw_data) ([[4, 17, 67, 76, 51,>>> print(raw_data) ([[4, 17, 67, 76, 51, 28, 3, 1, 0, 0, 0, 1], [0, 1, 8, 28, 69, 129, 83, 55, 19, 4, 0, 0], [0, 0, 0, 8, 86, 55, 0, 0, 0, 0, 0, 0], [0, 0, 1, 10, 24, 43, 64, 58, 58, 26, 12, 0], [0, 0, 2, 15, 56, 116, 51, 8, 0, 0, 0, 0]], 1337, 13)

28, 3, 1, 0, 0, 0, 1], [0, 1, 8, 28, 69,

Write a function parse_data (filename) that reads in a series of records from a file, each corresponding to a reported case of flu (from the years 2010-2014), and converts the data into a collection of monthly case counts for each year. The function should return a 3-tuple containing a nested list of monthly case counts for each year. This nested list should be 5 x 12 elements in size (please see below in the example); the number of valid records; and the number of invalid records The data in the file consists of records. Each record consists of four items: year, month (3-character code), age and sex. You will only need to use the first two items (year and month) This is an example of the data in the file case list.csv year,month,age,sex 2011,APR, 29,M 2011,MAR,37,F 2012,MAY,63,M 2012,Mxx,63,M Assumptions You can assume that each record is correctly formatted, but your function should only count valid records. A valid record is a record that has valid values for year and month. Valid years are: 2010, 2011,2012,2013,2014 Valid months are: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC Invalid records should be ignored >>> raw-data parse-data( 'case-list.csv ') =

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!