1. Follow the FDR to implement a function called add_average. This function must be placed inside the file Txxx_M1_load_data.py below load_data. Function Description: • The function will add the average of the student's grades (G1, G2 and G3) as an additional attribute to the dictionary. • It takes one input parameter (regardless of the key): (1) a dictionary • It returns the dictionary updated Sample output (assuming school as key): with the average grade.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Please answer this question in 10 mins I will upvote your answer. Python programming language for the question:-
1. Follow the FDR to implement a function called add_average. This function must be
placed inside the file Txxx_M1_load_data.py below load_data.
Function Description:
• The function will add the average of the student's grades (G1, G2 and G3) as an
additional attribute to the dictionary.
• It takes one input parameter (regardless of the key): (1) a dictionary
•
It returns the dictionary updated
Sample output (assuming school as key):
with the average grade.
Transcribed Image Text:1. Follow the FDR to implement a function called add_average. This function must be placed inside the file Txxx_M1_load_data.py below load_data. Function Description: • The function will add the average of the student's grades (G1, G2 and G3) as an additional attribute to the dictionary. • It takes one input parameter (regardless of the key): (1) a dictionary • It returns the dictionary updated Sample output (assuming school as key): with the average grade.
{ 'GP'
'MB'
.. }
:
:
[ {'Age': 18, 'StudyTime': 1.8, 'Failures': 0, 'Health': 3,
'Absences': 6, 'G1': 5, 'G2': 6, 'G3¹: 6, 'G_Avg': 5.67 },
{another element),
],
...
[ {'Age': 16, 'StudyTime': 2.6,
'Failures': 0, 'Health':
'Absences': 12, 'G1¹: 10, 'G2¹: 12, 'G3': 12, 'G_Avg': 11.33 },
{another element},
],
3,
2. Test your function. For this lab, you can just call your function to ensure that the data is
loaded correctly. For testing purposes, use student-mat.csv. Ensure that the function calls
are added to the end of the main script.
Transcribed Image Text:{ 'GP' 'MB' .. } : : [ {'Age': 18, 'StudyTime': 1.8, 'Failures': 0, 'Health': 3, 'Absences': 6, 'G1': 5, 'G2': 6, 'G3¹: 6, 'G_Avg': 5.67 }, {another element), ], ... [ {'Age': 16, 'StudyTime': 2.6, 'Failures': 0, 'Health': 'Absences': 12, 'G1¹: 10, 'G2¹: 12, 'G3': 12, 'G_Avg': 11.33 }, {another element}, ], 3, 2. Test your function. For this lab, you can just call your function to ensure that the data is loaded correctly. For testing purposes, use student-mat.csv. Ensure that the function calls are added to the end of the main script.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY