You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

886 lines
266 KiB

2 years ago
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"___\n",
"\n",
"<a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>\n",
"___\n",
"<center><em>Copyright by Pierian Data Inc.</em></center>\n",
"<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Matrix Plots\n",
"\n",
"**NOTE: Make sure to watch the video lecture, not all datasets are well suited for a heatmap or clustermap.**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The Data\n",
"\n",
"World Population Prospects publishes United Nations population estimates for all world countries and every year from 1950 to 2020, as well as projections for different scenarios (low, middle and high variants) from 2020 to 2100. The figures presented here correspond to middle variant projections for the given year.\n",
"\n",
"https://www.ined.fr/en/everything_about_population/data/all-countries/?lst_continent=900&lst_pays=926\n",
"\n",
"Source : Estimates for the current year based on data from the World Population Prospects. United Nations."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# 2020 Projections\n",
"df = pd.read_csv('country_table.csv')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Countries</th>\n",
" <th>Birth rate</th>\n",
" <th>Mortality rate</th>\n",
" <th>Life expectancy</th>\n",
" <th>Infant mortality rate</th>\n",
" <th>Growth rate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>AFRICA</td>\n",
" <td>32.577</td>\n",
" <td>7.837</td>\n",
" <td>63.472</td>\n",
" <td>44.215</td>\n",
" <td>24.40</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>ASIA</td>\n",
" <td>15.796</td>\n",
" <td>7.030</td>\n",
" <td>73.787</td>\n",
" <td>23.185</td>\n",
" <td>8.44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>EUROPE</td>\n",
" <td>10.118</td>\n",
" <td>11.163</td>\n",
" <td>78.740</td>\n",
" <td>3.750</td>\n",
" <td>0.38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>LATIN AMERICA AND THE CARIBBEAN</td>\n",
" <td>15.886</td>\n",
" <td>6.444</td>\n",
" <td>75.649</td>\n",
" <td>14.570</td>\n",
" <td>8.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>NORTHERN AMERICA</td>\n",
" <td>11.780</td>\n",
" <td>8.833</td>\n",
" <td>79.269</td>\n",
" <td>5.563</td>\n",
" <td>6.11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>OCEANIA</td>\n",
" <td>16.235</td>\n",
" <td>6.788</td>\n",
" <td>78.880</td>\n",
" <td>16.939</td>\n",
" <td>12.79</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>WORLD</td>\n",
" <td>17.963</td>\n",
" <td>7.601</td>\n",
" <td>72.766</td>\n",
" <td>27.492</td>\n",
" <td>10.36</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Countries Birth rate Mortality rate \\\n",
"0 AFRICA 32.577 7.837 \n",
"1 ASIA 15.796 7.030 \n",
"2 EUROPE 10.118 11.163 \n",
"3 LATIN AMERICA AND THE CARIBBEAN 15.886 6.444 \n",
"4 NORTHERN AMERICA 11.780 8.833 \n",
"5 OCEANIA 16.235 6.788 \n",
"6 WORLD 17.963 7.601 \n",
"\n",
" Life expectancy Infant mortality rate Growth rate \n",
"0 63.472 44.215 24.40 \n",
"1 73.787 23.185 8.44 \n",
"2 78.740 3.750 0.38 \n",
"3 75.649 14.570 8.89 \n",
"4 79.269 5.563 6.11 \n",
"5 78.880 16.939 12.79 \n",
"6 72.766 27.492 10.36 "
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Heatmap"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"df = df.set_index('Countries')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Birth rate</th>\n",
" <th>Mortality rate</th>\n",
" <th>Life expectancy</th>\n",
" <th>Infant mortality rate</th>\n",
" <th>Growth rate</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Countries</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>AFRICA</th>\n",
" <td>32.577</td>\n",
" <td>7.837</td>\n",
" <td>63.472</td>\n",
" <td>44.215</td>\n",
" <td>24.40</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ASIA</th>\n",
" <td>15.796</td>\n",
" <td>7.030</td>\n",
" <td>73.787</td>\n",
" <td>23.185</td>\n",
" <td>8.44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>EUROPE</th>\n",
" <td>10.118</td>\n",
" <td>11.163</td>\n",
" <td>78.740</td>\n",
" <td>3.750</td>\n",
" <td>0.38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LATIN AMERICA AND THE CARIBBEAN</th>\n",
" <td>15.886</td>\n",
" <td>6.444</td>\n",
" <td>75.649</td>\n",
" <td>14.570</td>\n",
" <td>8.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>NORTHERN AMERICA</th>\n",
" <td>11.780</td>\n",
" <td>8.833</td>\n",
" <td>79.269</td>\n",
" <td>5.563</td>\n",
" <td>6.11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>OCEANIA</th>\n",
" <td>16.235</td>\n",
" <td>6.788</td>\n",
" <td>78.880</td>\n",
" <td>16.939</td>\n",
" <td>12.79</td>\n",
" </tr>\n",
" <tr>\n",
" <th>WORLD</th>\n",
" <td>17.963</td>\n",
" <td>7.601</td>\n",
" <td>72.766</td>\n",
" <td>27.492</td>\n",
" <td>10.36</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Birth rate Mortality rate Life expectancy \\\n",
"Countries \n",
"AFRICA 32.577 7.837 63.472 \n",
"ASIA 15.796 7.030 73.787 \n",
"EUROPE 10.118 11.163 78.740 \n",
"LATIN AMERICA AND THE CARIBBEAN 15.886 6.444 75.649 \n",
"NORTHERN AMERICA 11.780 8.833 79.269 \n",
"OCEANIA 16.235 6.788 78.880 \n",
"WORLD 17.963 7.601 72.766 \n",
"\n",
" Infant mortality rate Growth rate \n",
"Countries \n",
"AFRICA 44.215 24.40 \n",
"ASIA 23.185 8.44 \n",
"EUROPE 3.750 0.38 \n",
"LATIN AMERICA AND THE CARIBBEAN 14.570 8.89 \n",
"NORTHERN AMERICA 5.563 6.11 \n",
"OCEANIA 16.939 12.79 \n",
"WORLD 27.492 10.36 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA3Y0lEQVR4nO3dd5wkdZ3/8dd7QXLOSFqSoOSgkvQIciaigrCigse5emfEE0XFh5hO0UMF092enoAi4RAEz1PhkCBBZEFYsuTwE4kqS2Zn3r8/qgaK3pnpnp2aqa7h/eRRj+n6VnX1p4be7s98o2wTERERUadpTQcQERERU08SjIiIiKhdEoyIiIioXRKMiIiIqF0SjIiIiKjdwk0HEDEVnfTSd0y54VlHPXtj0yFMiDlf2aXpEGp33zfnNB3ChPiPuSs2HcKEOPrOkzXeazz70O09fea8ZKX1xv1avUoNRkRERNQuNRgRERFtNzjQdATzSYIRERHRdgPzmo5gPkkwIiIiWs4ebDqE+STBiIiIaLvBJBgRERFRt9RgRERERO3SyTMiIiJqlxqMiIiIqJsziiQiIiJql06eERERUbs0kURERETt+rCTZ9YiidaRtK8kS9q43J8u6UlJV1e2RSQdIunBcv8mSYdVrnGUpI9V9j9WnnOdpGskvatybGVJz0p67+TeaUREjzzY2zaJkmBEG80ALgYOrJTdZnvLyvZMWX6q7S2BHYFPS1qr82KS3gfsDrzK9qbAa4HqioP7A78rXzciov8MzOttm0RJMKJVJC1FkSwcygsTjFHZfhi4FVh9mMOfAv7Z9qPluX+zfULl+AzgX4A1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
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Clearly shows life expectancy in different units\n",
"sns.heatmap(df)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"rates = df.drop('Life expectancy',axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAzd0lEQVR4nO3dd5hkdZ3+/fc9SM4ZBGFIooIwICpJlyArKiAoCCMqIOsYMICCAfEnpkfRRQUD7hiWsEhQRDAhLA5JBhBYwpAkBxmJIkFApvt+/jinnTM13V3VM9V9KtwvrnN1ne8J9amieurT3yjbRERERLTTpLoDiIiIiN6TBCMiIiLaLglGREREtF0SjIiIiGi7JBgRERHRdi+qO4CIXvTMF/fP8Cxgt+kP1x1Cxzj/uv+qO4SOce/rP1h3CB1lw5t/r4W9xwuP3tXSvzmLrrL+Qj9Xq1KDEREREW2XGoyIiIhuNzhQdwTzSYIRERHR7Qbm1B3BfJJgREREdDl7sO4Q5pMEIyIiotsNJsGIiIiIdksNRkRERLRdOnlGRERE26UGIyIiItrNGUUSERERbZdOnhEREdF2aSKJiIiItuvATp5ZiyS6jqS9JFnSy8r9yZKelXRdZVtM0oGSHin3b5V0WOUeR0s6vLJ/eHnOLEnXS3pP5diqkl6Q9P6JfaURES3yYGvbBEqCEd1oKnAZsF+l7E7bUyrbP8vyM2xPAbYDPivpJY03k/QBYBfgNbY3BV4PVFcc3Ae4onzeiIjOMzCntW0CJcGIriJpGYpk4WDmTTB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WBEREdGqTqz
"text/plain": [
"<Figure size 432x288 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.heatmap(rates)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA0/ElEQVR4nO3dd5xddZ3/8dcblN6lSgttcaVFRBcQXQKyIgKCwkIEBdclujZAxcLqz+jquuqiggWNZSkiRVFBEZTFACIRCCxdEJDQpYogApKZ9++Pc8ac3Ew5k9yZc8v7yeM8Mud72udeZuZ+5ltlm4iIiIh2WqrpACIiIqL3JMGIiIiItkuCEREREW2XBCMiIiLaLglGREREtN3zmg4gokdleFZE1KUlvcFzj/y+1u+c56+56RI/q64kGBET5KlPHtJ0CI1b8f+dBsC0DfZoOJLmzb73QgCee+T3DUfSvOevuSkAt7/4NQ1H0rzNb/550yFMmCQYERER3W5woOkIFpEEIyIiotsNzG86gkUkwYiIiOhy9mDTISwiCUZERES3G0yCEREREe2WGoyIiIhou3TyjIiIiLZLDUZERES0mzOKJCIiItounTwjIiKi7dJEEhEREW3XgZ08s5pqdB1J+0uypBeV+1MkPS3p2sq2jKTDJT1c7t8i6ejKPWZK+kBl/wPlOTdKuk7SWyrH1pL0nKS3T+4rjYioyYP1tkmUBCO60XTgMuDgStkdtqdWtr+W5Wfangq8Avh3SRu23kzSO4A9gJfb3hp4FQuvbngg8JvyuRERnWdgfr1tEiXBiK4iaSWKZOFtLJxgjMr2o8DtwHrDHD4WeKftJ8pz/2T75Mrx6cD7gQ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s_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.heatmap(rates,linewidth=0.5)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAABVdklEQVR4nO3ddZyUZdfA8d/ZXXopCUFSwMCkVMIApAwQRVQUxQKLRxTF9hXr0UdEQkXFAgQVBRQVUBEJQVJFBATplu7e2fP+cd8Lsz3A7Fyzs+fr5/4wc90xZ8aJs1eKqmKMMcYYE05xrgMwxhhjTOyxBMMYY4wxYWcJhjHGGGPCzhIMY4wxxoSdJRjGGGOMCbsE1wEYE6NseJYxJlRyohc4vGV5SN85+UpXO+HHCpUlGMbkkL0v3OI6BOeK/N8wAJpUbO44Evcmrh0PwOEtyx1H4l6+0tUAWHpWS8eRuFdj4Q+uQ8gxlmAYY4wxuV1ywHUE6ViCYYwxxuR2gSTXEaRjCYYxxhiTy6kmuw4hHUswjDHGmNwu2RIMY4wxxoSb1WAYY4wxJuysk6cxxhhjws5qMIwxxhgTbmqjSIwxxhgTdtbJ0xhjjDFhZ00kxpgcEZ+Pgrc/C/EJSFw8SX/P4vDkkeRrfD0JZ9RFVWHvLg6Ofhfds8N1tDmiUrWK/N87zxy5X75yOT5+fTAjP/zqSFmRooV5qv8TnFyhLPHx8Qx/bwTffxG7UzUDBAIBbrzrQcqWKc2AXs8fKf/40xH0fvtDfhnzOSVLFHcYYWQklCtD2Vd6kFC6JKrKri/GsnPo10f2l7jjekr36Mzyhu1J3rHLXaDHyzp5GnPiRORaYBRQU1UXiUhV4G9gcdB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axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.heatmap(rates,linewidth=0.5,annot=True)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAABVWElEQVR4nO3dd3yT5RbA8d9piwXKlC0gyBAFkY0C4gWVK+ICBRFxD9x74AbRqwKKe+ECFAeKiCKCiGwRBVRkKnvIXgXKanvuH+9bSEtHgDRPkp7v5/N+SJ535CSkyckzRVUxxhhjjAmlONcBGGOMMSb2WIJhjDHGmJCzBMMYY4wxIWcJhjHGGGNCzhIMY4wxxoRcgusAjIlRNjzLGBMsOdoLpK87MajPnLiKfx/1YwXLEgxj8knX6be4DsG5z1u8DUC7Vs84jsS9cdMeByB93YmOI3EvruLfAFR7v5/jSNxbccNDrkPIN5ZgGGOMMVEunfSgjgtnvwhLMIwxxpgot1/TgjounF/6lmAYY4wxUS7YGoxwsgTDGGOMiXJpEbjshyUYxhhjTJRLj8CBa5ZgGGOMMVEuzRIMY4wxxoSa1WAYY4wxJuT2Wx8MY4wxxoSaNZEYY4wxJuTSIi+/sATDmFiQvi+Nxc/9TnpqOqQpJZuVp1KnE1g7fCnbf98EIhQqUYjjbzyZQqUTXYebL6ocfyyP97nkwP2Kx5Vm8HuTGDHs1wNlRZMSefjJiylfoSTxCXF8+ckvjB39p4twwyYtDbr0gPLl4O3nD5Z/8Bn0f0v4eaRSupSz8MKmUlJxXjrzfMoVTSJdlU8W/cmH82Yd2N/jlGY8dlpbGn78Glv37nYY6ZG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
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Note how its not palette here\n",
"sns.heatmap(rates,linewidth=0.5,annot=True,cmap='viridis')"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAABUqElEQVR4nO3deZyNdfvA8c81YxvGElHKUiEtypASSShPUqSeNtEipZ5oUZGkUk+bFJVWlUeJtPhVKkuSnRSyFSq77MPYiZnr98d9D2fGLAdnzvcs1/v1ul/O/b2Xc53jzJxrvquoKsYYY4wxoZTgOgBjjDHGxB5LMIwxxhgTcpZgGGOMMSbkLMEwxhhjTMhZgmGMMcaYkCvkOgBjYpQNzzLGBEuO9QZVB70U1O+clXd0P+bnCpYlGMYUkLMe7+86BOd+f64rAFec9ojjSNwbvexlAKoOeslxJO6tvKM7AOd36Oc4Evd++d9DrkMoMNZEYowxxpiQsxoMY4wxJtplhK3lI2hWg2GMMcaYkLMaDGOMMSbKSQR2K7caDGOMMcaEnNVgGGOMMdHOajCMMcYYEw+sBsMYY4yJdhp5o0gswTDGGGOiXQQ2kViCYYwxxkQ7SzCMMQWhSKFEPrrrBookJlIoIYHvf/uTN8bP4L7LGtDszGqoKqk799BzxFg27djlOtwCcfKp5XlsQPuD+xUrl2PIq2P56n9TDpYVL1mM7v1upvxJZUhMTGDE+5MY98UvLsINmwQRvm19K+t37eSOH0YcLO9U63wev6ApKUMHsHXfHocRhscJZZPpfecVlCtdHFXly0kLGD7u14PH27c4jwduvITL7nuLbTv3Oow0dliCYaKOiFwD/B9w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es>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Set colorbar based on value from dataset\n",
"sns.heatmap(rates,linewidth=0.5,annot=True,cmap='viridis',center=40)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Countries'>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAFTCAYAAAB783UiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAABUFElEQVR4nO3dd5hU5dnH8e9vl4VdytKldxELKioWSlQssYK9YDcmmGJsscWYhGjyRmMvMUrsir1iRYMUEUQR6dKk996Xsrv3+8c5C7PLlgF25+zM3p/rOhczzylzzzCzc89TZWY455xzzpWntKgDcM4551zq8QTDOeecc+XOEwznnHPOlTtPMJxzzjlX7jzBcM4551y5qxZ1AM6lKB+e5ZyLl/b2AvlL94vrb05a0xl7/Vjx8gTDuQry6qyjow4hcpfsOwaAdq/8M+JIojfnsj8CkL90v4gjiV5a0xkA/HbcZRFHEr0nD38l6hAqjDeROOecc67ceQ2Gc845l+TyyY/ruETWKniC4ZxzziW5PIsvwUjkl743kTjnnHOu3HkNhnPOOZfk8ivhwDWvwXDOOedcufMaDOeccy7JxdvJM5E8wXDOOeeSXJ55E4lzzjnnqgCvwXDOOeeSXGXs5OkJhnMpIHeb8fztG8nbbuTnwQE9Muh1WRZfvpzD9G+2I0GtemmcfVNN6jRMzYrL9tkNeLzn2Tvut6pdj4cnfsXz077bUVYnowYP9+hN81rZpCuN/04dw9uzJ0UQbeLk5cEF/WCfxvDUvTvLn3sd7v+PGPWBUb9eZOElzJZVW5ny5By2rQ0+D81PbEzr05ru2D/voyXMGriQnz3dherZGRFGmjo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]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Set colorbar based on value from dataset\n",
"sns.heatmap(rates,linewidth=0.5,annot=True,cmap='viridis',center=1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Clustermap\n",
"\n",
"Plot a matrix dataset as a hierarchically-clustered heatmap."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.matrix.ClusterGrid at 0x158e27976c8>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsgAAALICAYAAABiqwZ2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA2+ElEQVR4nO3deZhlZ1kv7N+TAQKGgMyRqWUQFIQo5cDklyAOH0eFeIAQQYkHjX6iSDhEcgSPrUc0gAiigqdFT4IHJQgCARTBkDBGoIIhA4MyREAjYZLJBEnyfH/s1fJmp6q6Kunqqt5939e1r97rXe9a61lr7Up+9da7967uDgAAMHPQVhcAAADbiYAMAAADARkAAAYCMgAADARkAAAYCMgAADAQkAEAYCAgAwDAQEAGAIDBIRvp/NVPf2Rbfe3eobe8c211DQAALJYNBeRcfdUmlQEAANvDxgLyVVduUhkAALA9bCggt4DMAW5paemUJIdtdR2wjVyxvLx86lYXAbA3bXAE+aubVAbsNw5bXl7eudVFwHaxtLS0c6trANjbTLEAAICBKRYAADAwxQIAAAamWAAAwGDhA3JVHZxkOck/d/cPVdXNk5yRZEeSS5I8qrs/t3UVAgCwnWxsDvLV++UUi19M8v4kR0zLpyQ5q7tPrapTpuWnblVxAABsLws9glxVt0/yX5I8I8mTp+aHJTl6en56knMiIAMAMNmv36RXVScmOXFo2tXdu4bl5yX5pSQ3Gdpu092XJkl3X1pVt970Q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hyQfTXL7PW3Y3ecm+dMkv7j
"text/plain": [
"<Figure size 720x720 with 4 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.clustermap(rates)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.matrix.ClusterGrid at 0x158e235c9c8>"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsgAAALICAYAAABiqwZ2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA2kElEQVR4nO3deZhlV1kv/u9LAgRkniNTyyAoCFHKgfGXIA4/BSFeIERQ4kWj96JIuESi4LX1igQQQVTwtugNeFGCIBBAEQwJYwQ6GDIwqEAEJBImmUyQJO/94+yClZOq6qpOV1f16c/nec5TZ6+99t7v3uec7m+ts86p6u4AAAAz19jqAgAAYDsRkAEAYCAgAwDAQEAGAICBgAwAAAMBGQAABgIyAAAMBGQAABgIyAAAMDh0I52/9pmPbKs/u3fNm92htroGAAAWy4YCcq64fJPKAACA7WFjAfnyyzapDAAA2B42FJBbQAYAYMFtcAT5a5tUBgAAbA+mWAAAwMAUCwAAGJhiAQAAA1MsAABgsPABuaoOSbI7yb9294Or6iZJTk2yI8mFSR7Z3Z/fugoBANhONjYH+YoDcorFLyX5QJIbTMsnJTm9u0+uqpOm5adsVXEAAGwvCz2CXFW3SfKjSZ6e5ElT80OTHDndf3GSMyMgAwAwOaA/pFdVxyc5fmja1d27huXnJfnlJNcf2m7Z3RclSXdfVFW32PRCAQA4YBzQI8hTGN610rqqenCSi7v77Ko6cn/WBQDAgWtjAfmy7RWQ9+C+SX6sqn4kyWFJblBV/zfJp6rq8Gn0+PAkF29plQAAbCsb/EMh22uKxVq6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x
"text/plain": [
"<Figure size 720x720 with 4 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.clustermap(rates,col_cluster=False)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.matrix.ClusterGrid at 0x158e2ffc848>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA7oAAAI4CAYAAABEC5UKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA61UlEQVR4nO3deZxkd1kv/s+TBEiQfQ/rCERQUKKMKOtNAJWfihAvCBE04SKj94KyXIIIeh1XdkFU0AG9CVxkkTWAIhgS1ghMMCQBggiJgERCQFkTJDPP7486DZWiu7pnpqe7+uT9zuu8ps73bE+dqq70p7/fc6q6OwAAADAWh2x2AQAAALCeBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEX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dju1d292Oq6vpJPlZVr+7uT1fVTyf55ST36O5LquqHkry+qu7S3f8+bPuw7t5dVTuSPCvJz0y3H+gTgoNNjy4AAIxYd38hyb8kOXJo+vUkJ3X3JcPyDyY5Jcmjl9n8nUluuxF1wnrSowvrYPv27U9Ocvh67nP37t0713N/AMBiGnpNd0w17eruXVPzR1TV2VPzT+vuV+7D/m+Zye8p5wxNd0hy1sxqu5OcsMzm909y7tT8y6rq0uHx27r7pLXWARtJ0IX1cbhgCgDsjyHU7pqzykpDl3uVtodU1bFJbpfkUd192Zxj1My2S4H2wiS/OtVu6DJbgqHLAACwNX0hyXWn5q+X5JKp+Vd29x2S3DPJc6rqJkP7R5LceWZfPzS0L3lYdx/d3Q/s7k+vc91w0Am6AACwNZ2R5BeSpKoOTfLwJKfPrtTdZyZ5aZLHDk3PTPKM4SZVqaqjk5yY5AUHu2DYKIYuAwDAYpu9Rvct3f3kJL+X5IVV9aFMhh6/Jcn/W2Efz0jywar6w+4+tapuluS9VdVJvpLk4d190Rpqmb5G95Luvu/+PCE42ARdAABYYN196ArtX0ry8yssOznJyVPzn01yk6n5FyZ54QrbHrMv7bCIDF0GAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARkXQBQAAYFQEXQAAAEZF0AUAAGBUBF0AAABGRdAFAABgVARdAAAARuWweQu/eckneyOKuMoNbl0bcRwAAADGb27Qzd49G1QGAAAArI/5Qbf3blAZAAAAsD5W6dEVdAEAANha5gbd1qMLAADAFqNHFwAAgFFxjS4AAACj4q7LAAAAjIoeXQAAAEZl/s2o9ly+UXUAAADAunAzKlhg16mrbnYJbIJ/2/u1zS6BTXKdq15js0tgk9zg+tfe7BIARsXQZbaU7du3PznJ4ZtdxzK2bXYBAADAhJtRsdUcvnv37p2bXcSs7du379zsGgAAgAk9ugAAAIyKa3QBAAA
"text/plain": [
"<Figure size 864x576 with 4 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.clustermap(rates,col_cluster=False,figsize=(12,8),cbar_pos=(-0.1, .2, .03, .4))"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"rates.index.set_names('',inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Birth rate</th>\n",
" <th>Mortality rate</th>\n",
" <th>Infant mortality rate</th>\n",
" <th>Growth rate</th>\n",
" </tr>\n",
" <tr>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>AFRICA</th>\n",
" <td>32.577</td>\n",
" <td>7.837</td>\n",
" <td>44.215</td>\n",
" <td>24.40</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ASIA</th>\n",
" <td>15.796</td>\n",
" <td>7.030</td>\n",
" <td>23.185</td>\n",
" <td>8.44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>EUROPE</th>\n",
" <td>10.118</td>\n",
" <td>11.163</td>\n",
" <td>3.750</td>\n",
" <td>0.38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LATIN AMERICA AND THE CARIBBEAN</th>\n",
" <td>15.886</td>\n",
" <td>6.444</td>\n",
" <td>14.570</td>\n",
" <td>8.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>NORTHERN AMERICA</th>\n",
" <td>11.780</td>\n",
" <td>8.833</td>\n",
" <td>5.563</td>\n",
" <td>6.11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>OCEANIA</th>\n",
" <td>16.235</td>\n",
" <td>6.788</td>\n",
" <td>16.939</td>\n",
" <td>12.79</td>\n",
" </tr>\n",
" <tr>\n",
" <th>WORLD</th>\n",
" <td>17.963</td>\n",
" <td>7.601</td>\n",
" <td>27.492</td>\n",
" <td>10.36</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Birth rate Mortality rate \\\n",
" \n",
"AFRICA 32.577 7.837 \n",
"ASIA 15.796 7.030 \n",
"EUROPE 10.118 11.163 \n",
"LATIN AMERICA AND THE CARIBBEAN 15.886 6.444 \n",
"NORTHERN AMERICA 11.780 8.833 \n",
"OCEANIA 16.235 6.788 \n",
"WORLD 17.963 7.601 \n",
"\n",
" Infant mortality rate Growth rate \n",
" \n",
"AFRICA 44.215 24.40 \n",
"ASIA 23.185 8.44 \n",
"EUROPE 3.750 0.38 \n",
"LATIN AMERICA AND THE CARIBBEAN 14.570 8.89 \n",
"NORTHERN AMERICA 5.563 6.11 \n",
"OCEANIA 16.939 12.79 \n",
"WORLD 27.492 10.36 "
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rates"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.matrix.ClusterGrid at 0x158e354b508>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA7oAAAI4CAYAAABEC5UKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4XklEQVR4nO3deZxld1kn/s+TBAgY9jWytUAEASFADcrmJIDKD2WJA0ILmjhIOzMiEAeEQR1aFFkjyqhog04CgxJkjaBIDES2CDQYkgBBhIRFIiGghGCCpvv5/XFPwc1N1a3q7upaTt7vvM6r7/me7bnn3rqpT32/59zq7gAAAMBYHLLRBQAAAMBaEnQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFERdAEAABgVQRcAAIBREXQBAAAYFUEXAACAURF0AQAAGBVBFwAAgFE5bKMLAFb2zec9oTe6Bjbej++6eKNLYBN459l/tNElsAl87of++0aXwCZwp0/8dW10DbBZ6dEFAABgVARdAAAARkXQBQA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N5I8sbsvWkUt09foXtLdD92fJwSrJegCAMAIdfehy7R/PclPLbPs5CQnT81/KcmtpuZfkeQVy2x7zL60w8Fk6DIAAACjIugCAAAwKoIuAAAAoyLoAgAAMCqCLgAAAKMi6AIAADAqgi4AAACjIugCAAAwKoIuAAAAoyLoAgAAMCqCLgAAAKMi6AIAADAqgi4AAACjIugCAAAwKofNW/gfl3y216OIa93sDrUexwEAAGD85gbd7N2zTmUAAADA2pgfdHvvOpUBAAAAa2OFHl1BFwAAgK1lbtBtPboAAABsMXp0AQAAGBXX6AIAADAq7roMAADAqOjRBQAAYFTm34xqz5XrVQcAAACsCTejgi3gRnXtjS6BTeCf9n5zo0tgE7jRtY/Y6BLYBG520xtudAkAm5qhy2w5CwsLz05y+EbXMce2jS4AAACuydyMiq3o8N2
"text/plain": [
"<Figure size 864x576 with 4 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Recall you can always edit the DF before seaborn\n",
"sns.clustermap(rates,col_cluster=False,figsize=(12,8),cbar_pos=(-0.1, .2, .03, .4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"----\n",
"----"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 1
}