Problem

Consider the following csv dataset containing the temperature of cities around the world from 1995 to 2020. Each row in the file corresponds to the average temperature (in Fahrenheit) of a city in a given day of the year. Each observation has the following attributes: “Region,Country,State,City,Month,Day,Year,AvgTemperature”. We want to extract the data corresponding to the cities of Honolulu, Hawaii and Duluth, Minnesota and visualize them.

  1. Use Python Pandas library (or an equivalent tool in another language) to extract the rows of data corresponding to these two cities.
    Hint: You can use Pandas read_csv() function and data subsetting technique to select only rows whose city names match the names of interest.

  2. Use Python’s matplotlib library or an equivalent tool to visualize the data of the two cities similar to the graphs shown below.

  1. Which city has less fluctuating temperatures across days of the year? Prove this by computing the first and the second moments of the data corresponding to the two cities and reporting them here.

Comments