Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: Objective: Given the budget.csv file, read the date into a two-level nested dictionary. Calcula... Use Python Objective: Use Python Given the budget.csv file, read

Question: Objective: Given the budget.csv file, read the date into a two-level nested dictionary. Calcula... Use Python

Objective: Use Python

Given the budget.csv file, read the date into a two-level nested dictionary. Calculate and write the mean of each row and each column to a new file named resuit.txt.

Example Dialog:

For this data:

year 1 year 2 year 3

person 1 651000 651000 651000

person 2 1100500 950100 340000

person 3 740000 780000 800000

The value of the dictionary should look like this:

{'person 1': {'year 1': 651000, 'year 2': 651000, 'year 3': 651000}, 'person 2': {'year 1': 110500, 'year 2': 950100, 'year 3':340000}, 'person 3': {'year 1': 740000, 'year 2': 780000, 'year 3': 800000 }}

The content of 'resuit.txt should be:

The average of year1 is 830500.00

The average of year2 is 793700.00

The average of year3 is 597000.00

The average of person1 is 651000.00

The average of person2 is 796800.67

The average of person3 is 773333.33

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago