Question: Markdown Problem : Join two datasets You are given two files, each containing various measurements ( one measurement per line ) . For instance, these

Markdown
Problem : Join two datasets
You are given two files, each containing various measurements (one measurement per line). For instance, these measurements could represent the population of different cities (file #1) and their corresponding area in square miles (file #2). Each measurement line begins with an item label (the city name), followed by a comma, and the measurement value. The measurements are not in any specific order.
For example, file #1 could have the following lines:
DC,213280
MD,1198747
VA,239545
While file #2 these other lines:
MD,112.49
VA,412.34
DC,31.43
Your task is to join the two files and produce a third set of measurements (in this example, it could be the population per square mile). All new measurements should be rounded to two decimal places.
Your program should take three parameters : two filenames, and a string specifying the operation to perform. The acceptable operation options are "sum", "subtract", "multiply", or "divide" (in this instance, the operation to use would be "divide"). It should return a dictionary containing the new set of measurements, where each dictionary entry maps the item's label (key) to its new measurement (value).
Finally, your program must print the following message:
Created XX measurements with operation ZZZZ
where ZZZZ is one of the four options above.
Markdown Problem : Join two datasets You are

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!