{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Heatmap of Global Temperature Anomaly" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Global temperature anomaly (GTA, $^oC$) was downloaded from [NCDC](https://www.ncdc.noaa.gov/cag/global/time-series/globe/land_ocean/all/3/1958-2018). The data come from the Global Historical Climatology Network-Monthly (GHCN-M) data set and International Comprehensive Ocean-Atmosphere Data Set (ICOADS), which have data from 1880 to the present. These two datasets are blended into a single product to produce the combined global land and ocean temperature anomalies. The available time series of global-scale temperature anomalies are calculated with respect to the 20th-century average. \n", "\n", "The period from Jan/1958 to Mar/2018 was used in this notebook. The data are presented as Heatmap, which is a graphical representation of data where the individual values contained in a matrix are represented as colors. It is really useful to display a general view of numerical data, not to extract specific data point." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Load all needed libraries" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "matplotlib inline\n" ] } ], "source": [ "import pandas as pd\n", "import seaborn as sns\n", "from matplotlib import pyplot as plt\n", "import calendar\n", "\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Read global temperature anomaly" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "gta = pd.read_csv('data\\gta_1958_2018.csv', \n", " sep=\",\", \n", " skiprows=5,\n", " names = [\"Month\", \"GTA\"])\n", "gta['Month'] = pd.to_datetime(gta['Month'], format='%Y%m', errors='ignore')\n", "gta.set_index('Month', inplace=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.1 Convert to Year * Months" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Month | \n", "January | \n", "February | \n", "March | \n", "April | \n", "May | \n", "June | \n", "July | \n", "August | \n", "September | \n", "October | \n", "November | \n", "December | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
1958 | \n", "0.29 | \n", "0.21 | \n", "0.12 | \n", "0.11 | \n", "0.10 | \n", "0.06 | \n", "0.06 | \n", "0.05 | \n", "0.02 | \n", "0.04 | \n", "0.09 | \n", "0.15 | \n", "
1959 | \n", "0.12 | \n", "0.06 | \n", "0.20 | \n", "0.12 | \n", "0.02 | \n", "0.08 | \n", "0.07 | \n", "0.05 | \n", "0.09 | \n", "-0.02 | \n", "-0.08 | \n", "-0.04 | \n", "
1960 | \n", "0.00 | \n", "0.18 | \n", "-0.21 | \n", "-0.10 | \n", "-0.09 | \n", "0.07 | \n", "0.03 | \n", "0.04 | \n", "0.06 | \n", "0.03 | \n", "-0.05 | \n", "0.22 | \n", "
1961 | \n", "0.12 | \n", "0.17 | \n", "0.16 | \n", "0.13 | \n", "0.16 | \n", "0.15 | \n", "0.03 | \n", "0.03 | \n", "-0.01 | \n", "-0.04 | \n", "0.01 | \n", "-0.02 | \n", "
1962 | \n", "0.13 | \n", "0.17 | \n", "0.12 | \n", "0.07 | \n", "0.06 | \n", "0.06 | \n", "0.09 | \n", "0.05 | \n", "0.06 | \n", "0.08 | \n", "0.07 | \n", "0.08 | \n", "