Write a function hottest_city (csv_filename) that analyses the temperatures recorded in a CSV file, and returns a 2-tupl

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Write a function hottest_city (csv_filename) that analyses the temperatures recorded in a CSV file, and returns a 2-tupl

Post by answerhappygod »

Write A Function Hottest City Csv Filename That Analyses The Temperatures Recorded In A Csv File And Returns A 2 Tupl 1
Write A Function Hottest City Csv Filename That Analyses The Temperatures Recorded In A Csv File And Returns A 2 Tupl 1 (116.55 KiB) Viewed 46 times
Write a function hottest_city (csv_filename) that analyses the temperatures recorded in a CSV file, and returns a 2-tuple made up of the maximum temperature in the whole dataset, along with a sorted list of the names of cities where that temperature was recorded. The first column of the CSV file will contain the city name. The rest of the columns will be months of the year. The first row of the CSV files will provide column headings. Here is an example file (with an incomplete set of months): max_temp_tiny.csv city/month, Jan, Feb, Mar, Apr Melbourne, 41.2,35.5,37.4, 29.3 Brisbane, 31.3,40.2,37.9,29 Darwin, 34,34,33.2, 34.5 Here is an example of how hottest_city() should work: >>> hottest_city('max_temp_tiny.csv') (41.2, ['Melbourne']) Test File So you can test your answer, we have provided a full year of data for many Australian cities in a file called max_temp.csv. The data was obtained from the Bureau of Meteorology website.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply