Question: In Python - Write a menu driven program that analyzes a data file containing sensor information. The menu should provide following options: 1 - Read

In Python
-Write a menu driven program that analyzes a data file containing sensor information.
The menu should provide following options:
1- Read Sensor Data File
2- Analyze Data
3- Exit
Option 1 will read the provided datafile_lab2.txt
Download datafile_lab2.txtPreview the document file into lists. It will validate each line of information (aka record) to make sure that the record is complete.
The format of the data file is as follows:
Field 1- record number
Field 2- date / time
Field 3- temperature reading in Fahrenheit
NOTE: A missing field is an invalid record. A temperature field that doesn't contain an integer is an invalid record.
Option 2 will analyze the data and report:
- the number of days where the temperature was freezing or below
- the number of day where the temperature was 90 degrees or above.
-the coldest day (if more than one day with same low temp then report the first occurrence)
-the hottest day (if more than one day with same high temp then report the first occurrence)
- the number of invalid records
The program should end gracefully and thank the user with option 3. Data File contains: 67,Apr 13202012:04:05,97
68,Apr 14202012:04:05,39
69,Apr 15202012:04:05,24
70,Apr 16202012:04:05,24
71,Apr 17202012:04:05,97
72,Apr 18202012:04:05,94
73,Apr 19202012:04:05,9
74,Apr 20202012:04:05,71
75,Apr 21202012:04:05,NaN
76,Apr 22202012:04:05,72
77,Apr 23202012:04:05,46
78,Apr 24202012:04:05,83
79,Apr 25202012:04:05,19
80,Apr 26202012:04:05,92
81,Apr 27202012:04:05,7
82,Apr 28202012:04:05,13
83,Apr 29202012:04:05,15
84,Apr 30202012:04:05,62
85,May 01202012:04:05,0
86,May 02202012:04:05,57
87,May 03202012:04:05,85
88,May 04202012:04:05,49
89,May 05202012:04:05,4
90,May 06202012:04:05,32
91,May 07202012:04:05,46
92,May 08202012:04:05,61
93,May 09202012:04:05,12
94,May 10202012:04:05,93
95,May 11202012:04:05,6
96,May 12202012:04:05,35
97,May 13202012:04:05,8
98,May 14202012:04:05,NaN
99,May 15202012:04:05,77

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 Databases Questions!