Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q3 Write a function readNamesCounts(path) that reads from the file at location path and returns a dictionary with the information from the file. The format

image text in transcribed
Q3 Write a function readNamesCounts(path) that reads from the file at location path and returns a dictionary with the information from the file. The format of the file is a csv file. The first line is a comma- separated set of string names for the columns contained in the file. In this case, year, name, count. Subsequent lines have, on each line, comma separated values for a data mapping, where the first value gives the independent variable value of the year, and the second and third values on the line give the string name and the Integer count The returned dictionary should map from years to two-tuples consisting of a name and an integer count. Make sure your year keys are integers. Assign to variable temates the dictionary obtained from topfemale.csy and assign to variable mates the dictionary obtained from topmale.csv. Both tiles may be found in the datadir directory YOUR COON OR rakse Not implementediteror) Testing cell assert len males) - 139 assert 1880 in females assert 2011 in female assert females[1300-- "Hary, 7065) assert females 2018) - ma', 18688) assort len males) 139 assert 1880 in males assert 2018 in males assert males[18801 - 'John', 9655) assert males[2018] = ('Liam', 19837)

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago