{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Gapminder data choropleths" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import plotly.plotly as py\n", "import plotly.tools as tls\n", "import pandas as pd\n", "import json\n", "import urllib2\n", "import re" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The most famous gapminder data is featured in [Hans Rosling](https://en.wikipedia.org/wiki/Hans_Rosling)'s bubble charts (see a plotly version [here](https://plot.ly/~etpinard/191/fig-31b-hans-roslings-bubble-chart-for-the-year-2007/)).\n", "\n", "In this notebook, we'll explore the same dataset using plotly choropleths." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | country | \n", "year | \n", "pop | \n", "continent | \n", "lifeExp | \n", "gdpPercap | \n", "
---|---|---|---|---|---|---|
0 | \n", "Afghanistan | \n", "1952 | \n", "8425333 | \n", "Asia | \n", "28.801 | \n", "779.445314 | \n", "
1 | \n", "Afghanistan | \n", "1957 | \n", "9240934 | \n", "Asia | \n", "30.332 | \n", "820.853030 | \n", "
2 | \n", "Afghanistan | \n", "1962 | \n", "10267083 | \n", "Asia | \n", "31.997 | \n", "853.100710 | \n", "
3 | \n", "Afghanistan | \n", "1967 | \n", "11537966 | \n", "Asia | \n", "34.020 | \n", "836.197138 | \n", "
4 | \n", "Afghanistan | \n", "1972 | \n", "13079460 | \n", "Asia | \n", "36.088 | \n", "739.981106 | \n", "
5 rows × 6 columns
\n", "