Exercises for Submission: You may only write for-loops for this lab. Do not add any other type of loop. For this lab, students are given some skeleton code that must be filled in (named: L5 starter.py). Do not delete or change any of the code that is currently written. Ensure to read the comments fully for information regarding the functions and where code must be added. A car rental company is interested in tracking the temperate in the passenger seat of their fleet of cars to understand which cars might need to be inspected soon. They have decided to place temperature sensors in 100 of their cars and record the temperate of each car for 30 days. They have stored all the data is a csv file which contains 100 rows and 30 columns, corresponding to the 100 cars and 30 days respectively. This is provided as L5_Data.csv. Download this file into the same directory as the script you are creating for this lab. They have contracted you to do some analysis on the data. Part 1: For each row of data, you should calculate the following two quantities: 1. Mean 2. Standard Deviation Check out the following link for formulas: https://byjus.com/statistics-formulas/ In the script, you will need to fill out the appropriate functions to calculate these values. Each function should take in a list of floats and return a value corresponding to the quantity. The functions should not print anything, ask for any values, or write to a file. You must implement the formula descripted in the link. Part 2: Once you calculate the two statistical quantities, store them to another csv file called 'L5_Statistics.csv'. Your csv should contain the data in the following format (numbers are not reflective of the data, and are just examples for demonstration purposes): Row Standard Deviation High Temperature 1 2 Mean 35.12 23.52 9.15 7.98 0 Your output CSV should contain headers in the first row as shown above. The first column should contain the row number, the second column should contain the mean of the row read from the original file, the third column should contain the standard deviation of the row read from the original file, and the fourth column should be a 1 or 0 based on the computed mean value. If the mean is greater than 30, the value should be 1, otherwise it should be 0.

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question

Part 1 only.

Exercises for Submission:
You may only write for-loops for this lab. Do not add any other type of loop.
For this lab, students are given some skeleton code that must be filled in (named:
L5_starter.py). Do not delete or change any of the code that is currently written.
Ensure to read the comments fully for information regarding the functions and where
code must be added.
A car rental company is interested in tracking the temperate in the passenger seat of
their fleet of cars to understand which cars might need to be inspected soon. They have
decided to place temperature sensors in 100 of their cars and record the temperate of
each car for 30 days. They have stored all the data is a csv file which contains 100 rows
and 30 columns, corresponding to the 100 cars and 30 days respectively. This is
provided as L5_Data.csv. Download this file into the same directory as the script you
are creating for this lab. They have contracted you to do some analysis on the data.
Part 1:
For each row of data, you should calculate the following two quantities:
1. Mean
2. Standard Deviation
Check out the following link for formulas: https://byjus.com/statistics-formulas/
In the script, you will need to fill out the appropriate functions to calculate these values.
Each function should take in a list of floats and return a value corresponding to the
quantity. The functions should not print anything, ask for any values, or write to a file.
You must implement the formula descripted in the link.
Part 2:
Once you calculate the two statistical quantities, store them to another csv file called
'L5_Statistics.csv'. Your csv should contain the data in the following format (numbers
are not reflective of the data, and are just examples for demonstration purposes):
Row
Standard Deviation High Temperature
1
1
2
0
Mean
35.12
23.52
9.15
7.98
Your output CSV should contain headers in the first row as shown above. The first
column should contain the row number, the second column should contain the mean of
the row read from the original file, the third column should contain the standard
deviation of the row read from the original file, and the fourth column should be a 1 or 0
based on the computed mean value. If the mean is greater than 30, the value should be
1, otherwise it should be 0.
Sample Inputs and Outputs:
This is the first 20 rows of the output csv.
Row
Mean
Standard Deviation
8.916979614
8.672748084
8.851172658
7.988435555
9.74050136
6.080516389
8.678899563
7.508051605
9.66474197
8.122206392
8.514783194
6.618610816
9.47990627
7.840790841
8.477246076
8.79215697
8.466136707
7.878483347
10.23627657
6.903037289
1 33.06355
2 22.06967
3 31.67723
4 32.71311
5 26.32925
6 18.38821
7 29.66804
8 28.3451
9 20.5486
10 30.82423
11 29.14027
12 18.50075
13 32.62856
14 29.43722
15 19.74408
16 25.91741
17 21.54093
18 23.32322
19 25.2576
20 22.07418
High Temperature
1
0
1
1
0
0
0
0
0
1
0
0
1
OOO
0
0
0
OOOO
0
Transcribed Image Text:Exercises for Submission: You may only write for-loops for this lab. Do not add any other type of loop. For this lab, students are given some skeleton code that must be filled in (named: L5_starter.py). Do not delete or change any of the code that is currently written. Ensure to read the comments fully for information regarding the functions and where code must be added. A car rental company is interested in tracking the temperate in the passenger seat of their fleet of cars to understand which cars might need to be inspected soon. They have decided to place temperature sensors in 100 of their cars and record the temperate of each car for 30 days. They have stored all the data is a csv file which contains 100 rows and 30 columns, corresponding to the 100 cars and 30 days respectively. This is provided as L5_Data.csv. Download this file into the same directory as the script you are creating for this lab. They have contracted you to do some analysis on the data. Part 1: For each row of data, you should calculate the following two quantities: 1. Mean 2. Standard Deviation Check out the following link for formulas: https://byjus.com/statistics-formulas/ In the script, you will need to fill out the appropriate functions to calculate these values. Each function should take in a list of floats and return a value corresponding to the quantity. The functions should not print anything, ask for any values, or write to a file. You must implement the formula descripted in the link. Part 2: Once you calculate the two statistical quantities, store them to another csv file called 'L5_Statistics.csv'. Your csv should contain the data in the following format (numbers are not reflective of the data, and are just examples for demonstration purposes): Row Standard Deviation High Temperature 1 1 2 0 Mean 35.12 23.52 9.15 7.98 Your output CSV should contain headers in the first row as shown above. The first column should contain the row number, the second column should contain the mean of the row read from the original file, the third column should contain the standard deviation of the row read from the original file, and the fourth column should be a 1 or 0 based on the computed mean value. If the mean is greater than 30, the value should be 1, otherwise it should be 0. Sample Inputs and Outputs: This is the first 20 rows of the output csv. Row Mean Standard Deviation 8.916979614 8.672748084 8.851172658 7.988435555 9.74050136 6.080516389 8.678899563 7.508051605 9.66474197 8.122206392 8.514783194 6.618610816 9.47990627 7.840790841 8.477246076 8.79215697 8.466136707 7.878483347 10.23627657 6.903037289 1 33.06355 2 22.06967 3 31.67723 4 32.71311 5 26.32925 6 18.38821 7 29.66804 8 28.3451 9 20.5486 10 30.82423 11 29.14027 12 18.50075 13 32.62856 14 29.43722 15 19.74408 16 25.91741 17 21.54093 18 23.32322 19 25.2576 20 22.07418 High Temperature 1 0 1 1 0 0 0 0 0 1 0 0 1 OOO 0 0 0 OOOO 0
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman