Write a function max_city_temp (csv_filename, city) which analyses temperatures recorded in a CSV file, and returns the
Posted: Thu May 05, 2022 1:19 pm
Write a function max_city_temp (csv_filename, city) which analyses temperatures recorded in a CSV file, and returns the maximum temperature recorded for the named city. Once again, the first column of the CSV file will be the city name, and the rest of the columns will be months of the year. The first row of the CSV file will provide the column headings. Here is an example file fragment: max_temp_small.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 max_city_temp() should work: >>> max_city_temp ('max_temp_small.csv', 'Brisbane') 40.2 Test File So you can test your code, 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.