We are interested in finding outlier temperatures and comparing t run average.
We are interested in finding outlier temperatures and comparing t run average.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![We are interested in finding outlier temperatures and comparing them to the long
run average.
Start a new program temp_file_stats.py from your working version of
read_temp_file.py. Comment out the line that prints out the year and temperature
for each year in the file.
Add code to find the minimum and maximum temperature for all of the years in
the file and the years they occured in. You can base your solution on the
starbucks_menu.py program we went over in lecture. Here is a transcript of how
the program should work:
Temperature anomaly filename:SacramentoTemps.csv
Min temp: -2.32 in 1913
Max temp: 2.99 in 1889](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5d321746-c77e-4de9-b25c-dd05ca6fd42f%2F9fd88de4-c5a6-42bf-b673-03c9e7d366f9%2Figl3oeb_processed.png&w=3840&q=75)
Transcribed Image Text:We are interested in finding outlier temperatures and comparing them to the long
run average.
Start a new program temp_file_stats.py from your working version of
read_temp_file.py. Comment out the line that prints out the year and temperature
for each year in the file.
Add code to find the minimum and maximum temperature for all of the years in
the file and the years they occured in. You can base your solution on the
starbucks_menu.py program we went over in lecture. Here is a transcript of how
the program should work:
Temperature anomaly filename:SacramentoTemps.csv
Min temp: -2.32 in 1913
Max temp: 2.99 in 1889
![Sacramento
Year Value
1880
-1.56
1881
-0.08
1882
-0.3
1883
-1.44
1884
-2.29
1885 -1.95
1886
-0.63
1887
0.63
1888
-0.72
1889
2.99
1890
-0.5
1891
-1.36
1892
1.03
1893
-0.16
1894
-0.01
1895 -1.46
1896
-1.23
1897
-0.83
1898
-0.91
1899
1.53
1900
1.08
1901
0.24
1902 -1.08
1903
-1.1
1904 -0.83
1905
-0.31](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5d321746-c77e-4de9-b25c-dd05ca6fd42f%2F9fd88de4-c5a6-42bf-b673-03c9e7d366f9%2F6he9vb8_processed.png&w=3840&q=75)
Transcribed Image Text:Sacramento
Year Value
1880
-1.56
1881
-0.08
1882
-0.3
1883
-1.44
1884
-2.29
1885 -1.95
1886
-0.63
1887
0.63
1888
-0.72
1889
2.99
1890
-0.5
1891
-1.36
1892
1.03
1893
-0.16
1894
-0.01
1895 -1.46
1896
-1.23
1897
-0.83
1898
-0.91
1899
1.53
1900
1.08
1901
0.24
1902 -1.08
1903
-1.1
1904 -0.83
1905
-0.31
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
Step 1
SOURCE CODE
#!/usr/bin/python3
import csv
CSV_FILE = input("Temperature anomaly file name:")
with open(CSV_FILE) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
row_1=next(csv_reader)
max=float(row_1[1])
min=float(row_1[1])
max_Y=row_1[0]
min_y=row_1[0]
for row in csv_reader:
if float(row[1])<min:
min=float(row[1])
min_y=row[0]
if float(row[1])>max:
max=float(row[1])
max_y=row[0]
print("Min temp:", min," in ",min_y)
print("Max temp:", max," in ",max_y)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education