Comparing-Global-Temperature-and-Ottawa-Temperature

Instructions

Your goal will be to create a visualization and prepare a write up describing the similarities and differences between global temperature trends and temperature trends in Ottawa.

Extract the data from the database.

There's a workspace in the next section that is connected to a database. You’ll need to export the temperature data for the world as well as for the closest big city to where you live. You can find a list of cities and countries in the city_list table. To interact with the database, you'll need to write a SQL query.

  • Write a SQL query to extract the city level data. Export to CSV.
  • Write a SQL query to extract the global data. Export to CSV.

Open up the CSV in whatever tool you feel most comfortable using.

We suggest using Excel or Google sheets, but you are welcome to use another tool, such as Python or R.

Create a line chart that compares Ottawa’s temperatures with the global temperatures.

Make sure to plot the moving average rather than the yearly averages in order to smooth out the lines, making trends more observable (the last concept in the previous lesson goes over how to do this in a spreadsheet).

Make observations about the similarities and differences between the world averages and your Ottawa’s averages, as well as overall trends.

  • Question 1: Is your city hotter or cooler on average compared to the global average? Has the difference been consistent over time?

  • Question 2: How do the changes in Ottawa’s temperatures over time compare to the changes in the global average?

  • Question 3: What does the overall trend look like? Has the trend been consistent over the last few hundred years?

  • Question 4: What is the correlation coefficient between Ottawa’s temperature and global temperature?