{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise notebook 3: Transforming and Combining Data\n", "\n", "This Jupyter notebook is for Part 3 of The Open University's _Learn to code for Data Analysis_ course.\n", "\n", "This notebook has all code examples and coding exercises. Remember to start by running the code in this notebook. You will need to add a code cell below each task to complete it.\n", "\n", "You'll come across steps in the course directing you to this notebook. Once you've done each exercise, go back to the corresponding step and mark it as complete." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import warnings\n", "warnings.simplefilter('ignore', FutureWarning)\n", "\n", "from pandas import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 1: Creating the data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Dataframes can be constructed from scratch as follows." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CountryGDP (US$)
0UK2.678455e+12
1USA1.676810e+13
2China9.240270e+12
3Brazil2.245673e+12
4South Africa3.660579e+11
\n", "
" ], "text/plain": [ " Country GDP (US$)\n", "0 UK 2.678455e+12\n", "1 USA 1.676810e+13\n", "2 China 9.240270e+12\n", "3 Brazil 2.245673e+12\n", "4 South Africa 3.660579e+11" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "headings = ['Country', 'GDP (US$)']\n", "table = [\n", " ['UK', 2678454886796.7], # 1st row\n", " ['USA', 16768100000000.0], # 2nd row\n", " ['China', 9240270452047.0], # and so on...\n", " ['Brazil', 2245673032353.8],\n", " ['South Africa', 366057913367.1]\n", "]\n", "gdp = DataFrame(columns=headings, data=table)\n", "gdp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And similarly for the life expectancy of those born in 2013..." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameLife expectancy (years)
0China75
1Russia71
2United States79
3India66
4United Kingdom81
\n", "
" ], "text/plain": [ " Country name Life expectancy (years)\n", "0 China 75\n", "1 Russia 71\n", "2 United States 79\n", "3 India 66\n", "4 United Kingdom 81" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "headings = ['Country name', 'Life expectancy (years)']\n", "table = [\n", " ['China', 75],\n", " ['Russia', 71], \n", " ['United States', 79],\n", " ['India', 66],\n", " ['United Kingdom', 81]\n", "]\n", "life = DataFrame(columns=headings, data=table)\n", "life" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Create a dataframe with all five BRICS countries and their population, in thousands of inhabitants, in 2013. The values (given in the first exercise notebook) are: Brazil 200362, Russian Federation 142834, India 1252140, China 1393337, South Africa 52776." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 2: Defining functions\n", "\n", "The following function, written in two different ways, rounds a number to the nearest million. It calls the Python function `round()` which rounds a decimal number to the nearest integer. If two integers are equally near, it rounds to the even integer." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def roundToMillions (value):\n", " result = round(value / 1000000)\n", " return result" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def roundToMillions (value):\n", " return round(value / 1000000)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To test a function, write expressions that check for various argument values whether the function returns the expected value in each case." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "roundToMillions(4567890.1) == 5" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "roundToMillions(0) == 0 # always test with zero..." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "roundToMillions(-1) == 0 # ...and negative numbers" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "roundToMillions(1499999) == 1 # test rounding to the nearest" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The next function converts US dollars to British pounds." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def usdToGBP (usd):\n", " return usd / 1.564768 # average rate during 2013 \n", "\n", "usdToGBP(0) == 0" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "usdToGBP(1.564768) == 1" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "usdToGBP(-1) < 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tasks\n", "\n", "1. Define a few more test cases for both functions.\n", "- Why can't you use `roundToMillions()` to round the population to millions of inhabitants? Write a new function and test it. **You need to write this function in preparation for Exercise 4.**\n", "- Write a function to convert US dollars to your local currency. If your local currency is USD or GBP, convert to Euros. Look up online what was the average exchange rate in 2013." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 3: What if...?\n", "\n", "The next function uses the full form of the conditional statement to expand the abbreviated country names UK and USA and leave other names unchanged." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def expandCountry (name):\n", " if name == 'UK':\n", " return 'United Kingdom'\n", " elif name == 'USA':\n", " return 'United States'\n", " else:\n", " return name\n", "\n", "expandCountry('India') == 'India'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is the same function, written differently, using the simplest form of the conditional statement, without the `elif` and `else` parts." ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def expandCountry (name):\n", " if name == 'UK':\n", " name = 'United Kingdom'\n", " if name == 'USA':\n", " name = 'United States'\n", " return name" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tasks\n", "\n", "1. Write more tests.\n", "- Explain why the second version of the function works. Note how the code is indented.\n", "- Extend both versions to expand 'St. Lucia' to 'Saint Lucia'.\n", "- Write a function to translate some country names from their original language to English, e.g. 'Brasil' to 'Brazil', 'España' to 'Spain' and 'Deutschland' to 'Germany'.\n", "- Can you think of a different way of expanding abbreviated country names? You're not expected to write any code. Hint: this is a course about data tables." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4: Applying functions\n", "\n", "A one-argument function can be applied to each cell in a column, in order to obtain a new column with the converted values." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CountryGDP (US$)Country name
0UK2.678455e+12United Kingdom
1USA1.676810e+13United States
2China9.240270e+12China
3Brazil2.245673e+12Brazil
4South Africa3.660579e+11South Africa
\n", "
" ], "text/plain": [ " Country GDP (US$) Country name\n", "0 UK 2.678455e+12 United Kingdom\n", "1 USA 1.676810e+13 United States\n", "2 China 9.240270e+12 China\n", "3 Brazil 2.245673e+12 Brazil\n", "4 South Africa 3.660579e+11 South Africa" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdp['Country name'] = gdp['Country'].apply(expandCountry)\n", "gdp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Given that `apply()` is a column method that returns a column, it can be **chained**, to apply several conversions in one go." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CountryGDP (US$)Country nameGDP (£m)
0UK2.678455e+12United Kingdom1711727
1USA1.676810e+13United States10716029
2China9.240270e+12China5905202
3Brazil2.245673e+12Brazil1435148
4South Africa3.660579e+11South Africa233937
\n", "
" ], "text/plain": [ " Country GDP (US$) Country name GDP (£m)\n", "0 UK 2.678455e+12 United Kingdom 1711727\n", "1 USA 1.676810e+13 United States 10716029\n", "2 China 9.240270e+12 China 5905202\n", "3 Brazil 2.245673e+12 Brazil 1435148\n", "4 South Africa 3.660579e+11 South Africa 233937" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdp['GDP (£m)'] = gdp['GDP (US$)'].apply(usdToGBP).apply(roundToMillions)\n", "gdp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Applying the conversion functions in a different order will lead to a different result." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 1711727\n", "1 10716029\n", "2 5905201\n", "3 1435148\n", "4 233938\n", "Name: GDP (US$), dtype: int64" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdp['GDP (US$)'].apply(roundToMillions).apply(usdToGBP).apply(round)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The original columns can be discarded." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)
0United Kingdom1711727
1United States10716029
2China5905202
3Brazil1435148
4South Africa233937
\n", "
" ], "text/plain": [ " Country name GDP (£m)\n", "0 United Kingdom 1711727\n", "1 United States 10716029\n", "2 China 5905202\n", "3 Brazil 1435148\n", "4 South Africa 233937" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "headings = ['Country name', 'GDP (£m)']\n", "gdp = gdp[headings]\n", "gdp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Take the dataframe you created for Exercise 1, and apply to its population column the rounding function you wrote in Exercise 2." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 5: Joining left, right and centre\n", "\n", "At this point, both tables have a common column, 'Country name', with fully expanded country names." ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameLife expectancy (years)
0China75
1Russia71
2United States79
3India66
4United Kingdom81
\n", "
" ], "text/plain": [ " Country name Life expectancy (years)\n", "0 China 75\n", "1 Russia 71\n", "2 United States 79\n", "3 India 66\n", "4 United Kingdom 81" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "life" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)
0United Kingdom1711727
1United States10716029
2China5905202
3Brazil1435148
4South Africa233937
\n", "
" ], "text/plain": [ " Country name GDP (£m)\n", "0 United Kingdom 1711727\n", "1 United States 10716029\n", "2 China 5905202\n", "3 Brazil 1435148\n", "4 South Africa 233937" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A **left join** takes the rows of the left table and adds the columns of the right table. " ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)Life expectancy (years)
0United Kingdom171172781.0
1United States1071602979.0
2China590520275.0
3Brazil1435148NaN
4South Africa233937NaN
\n", "
" ], "text/plain": [ " Country name GDP (£m) Life expectancy (years)\n", "0 United Kingdom 1711727 81.0\n", "1 United States 10716029 79.0\n", "2 China 5905202 75.0\n", "3 Brazil 1435148 NaN\n", "4 South Africa 233937 NaN" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "merge(gdp, life, on='Country name', how='left')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A **right join** takes the rows from the right table, and adds the columns of the left table." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)Life expectancy (years)
0United Kingdom1711727.081
1United States10716029.079
2China5905202.075
3RussiaNaN71
4IndiaNaN66
\n", "
" ], "text/plain": [ " Country name GDP (£m) Life expectancy (years)\n", "0 United Kingdom 1711727.0 81\n", "1 United States 10716029.0 79\n", "2 China 5905202.0 75\n", "3 Russia NaN 71\n", "4 India NaN 66" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "merge(gdp, life, on='Country name', how='right')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "An **outer join** takes the union of the rows, i.e. it has all the rows of the left and right joins." ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)Life expectancy (years)
0United Kingdom1711727.081.0
1United States10716029.079.0
2China5905202.075.0
3Brazil1435148.0NaN
4South Africa233937.0NaN
5RussiaNaN71.0
6IndiaNaN66.0
\n", "
" ], "text/plain": [ " Country name GDP (£m) Life expectancy (years)\n", "0 United Kingdom 1711727.0 81.0\n", "1 United States 10716029.0 79.0\n", "2 China 5905202.0 75.0\n", "3 Brazil 1435148.0 NaN\n", "4 South Africa 233937.0 NaN\n", "5 Russia NaN 71.0\n", "6 India NaN 66.0" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "merge(gdp, life, on='Country name', how='outer')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "An **inner join** takes the intersection of the rows (i.e. the common rows) of the left and right joins." ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Country nameGDP (£m)Life expectancy (years)
0United Kingdom171172781
1United States1071602979
2China590520275
\n", "
" ], "text/plain": [ " Country name GDP (£m) Life expectancy (years)\n", "0 United Kingdom 1711727 81\n", "1 United States 10716029 79\n", "2 China 5905202 75" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdpVsLife = merge(gdp, life, on='Country name', how='inner')\n", "gdpVsLife" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Join your population dataframe (from Exercise 4) with `gdpVsLife`, in four different ways, and note the differences." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 6: Constant variables\n", "\n", "Constants are used to represent fixed values (e.g. strings and numbers) that occur frequently in a program. Constant names are conventionally written in uppercase, with underscores to separate multiple words." ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'GDP (US$)'" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "GDP_USD = 'GDP (US$)'\n", "GDP_GBP = 'GDP (£m)'\n", "GDP_USD" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Look through the code you wrote so far, and rewrite it using constants, when appropriate." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 7: Getting real\n", "\n", "It is possible to directly download data from the World Bank, for a particular time period and indicator, like the GDP in current US dollars. The indicator name is given in the URL of the webpage about the dataset.\n", "\n", "Getting the data directly from the World Bank only works with Anaconda (or a paid CoCalc account) and requires an Internet connection. It can take some time to download the data, depending on the speed of your connection and the load on the World Bank server. Moreover, the World Bank occasionally changes the layout of the data, which could break the code in the rest of this notebook. \n", "\n", "To avoid such problems I have saved the World Bank data into CSV files. The data is in a column with the same name as the indicator. Hence I declare the indicator names as constants, to be used later when processing the dataframe." ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": true }, "outputs": [], "source": [ "GDP_INDICATOR = 'NY.GDP.MKTP.CD'\n", "gdpReset = read_csv('WB GDP 2013.csv')\n", "\n", "LIFE_INDICATOR = 'SP.DYN.LE00.IN'\n", "lifeReset = read_csv('WB LE 2013.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The CSV files were obtained in two steps, which are shown next in commented code because we already have the CSV files. \n", "\n", "First the data was obtained directly from the World Bank using a particular function in pandas, and indicating the desired indicator and time period. Note that you may have to install the `pandas_datareader` module, using Anaconda Navigator." ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "# from pandas_datareader.wb import download\n", "\n", "# YEAR = 2013\n", "# gdpWB = download(indicator=GDP_INDICATOR, country='all', start=YEAR, end=YEAR)\n", "# lifeWB = download(indicator=LIFE_INDICATOR, country='all', start=YEAR, end=YEAR)\n", "# lifeWB.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The downloaded dataframe has descriptive row names instead of the usual 0, 1, 2, etc. In other words, the dataframe's index is given by the country and year instead of integers. Hence the second step was to reset the index. " ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "# gdpReset = gdpWB.reset_index()\n", "# lifeReset = lifeWB.reset_index()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Resetting the index put the dataframes into the usual form, which was saved to CSV files. " ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryyearSP.DYN.LE00.IN
0Arab World201370.631305
1Caribbean small states201371.901964
2Central Europe and the Baltics201376.127583
3East Asia & Pacific (all income levels)201374.604619
4East Asia & Pacific (developing only)201373.657617
\n", "
" ], "text/plain": [ " country year SP.DYN.LE00.IN\n", "0 Arab World 2013 70.631305\n", "1 Caribbean small states 2013 71.901964\n", "2 Central Europe and the Baltics 2013 76.127583\n", "3 East Asia & Pacific (all income levels) 2013 74.604619\n", "4 East Asia & Pacific (developing only) 2013 73.657617" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lifeReset.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tasks\n", "\n", "1. Create a data frame with the World Bank's data on population, using the CSV file provided. **This dataframe will be used in the remaining exercises.**\n", "- If you're using Anaconda, uncomment the code above and run it to check that you can get the GDP and life expectancy data directly from the World Bank. **Don't forget to afterwards comment again the code.**\n", "- If you have extra time, you can alternatively obtain the population data directly from the World Bank: go to their [data page](http://data.worldbank.org/), search for population, select the total population indicator, note its name in the URL, copy the commented code above and adapt it to get the data and reset its index. Note that the World Bank may have changed its data format since this was written and therefore you may have to do extra steps to get a dataframe in the same shape as the CSV file we provide, with three columns for country name, year and population." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 8: Cleaning up\n", "\n", "The expression `frame[m:n]` represents a dataframe with only row `m` to row `n-1` (or until the end if `n` is omitted) of `frame`." ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryyearSP.DYN.LE00.IN
0Arab World201370.631305
1Caribbean small states201371.901964
2Central Europe and the Baltics201376.127583
\n", "
" ], "text/plain": [ " country year SP.DYN.LE00.IN\n", "0 Arab World 2013 70.631305\n", "1 Caribbean small states 2013 71.901964\n", "2 Central Europe and the Baltics 2013 76.127583" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lifeReset[0:3]" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryyearSP.DYN.LE00.IN
240Vanuatu201371.669244
241Venezuela, RB201374.074415
242Vietnam201375.756488
243Virgin Islands (U.S.)201379.624390
244West Bank and Gaza201373.203341
245Yemen, Rep.201363.583512
246Zambia201359.237366
247Zimbabwe201355.633000
\n", "
" ], "text/plain": [ " country year SP.DYN.LE00.IN\n", "240 Vanuatu 2013 71.669244\n", "241 Venezuela, RB 2013 74.074415\n", "242 Vietnam 2013 75.756488\n", "243 Virgin Islands (U.S.) 2013 79.624390\n", "244 West Bank and Gaza 2013 73.203341\n", "245 Yemen, Rep. 2013 63.583512\n", "246 Zambia 2013 59.237366\n", "247 Zimbabwe 2013 55.633000" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lifeReset[240:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The first rows of World Bank dataframes are aggregated data for country groups, and are thus discarded. There were 34 country groups when I generated the CSV files, but the World Bank sometimes adds or removes groups. Therefore, if you obtained the data directly from the World Bank, you may need to discard more or fewer than 34 rows to get a dataframe that starts with Afghanistan." ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryyearNY.GDP.MKTP.CD
34Afghanistan20132.045894e+10
35Albania20131.278103e+10
36Algeria20132.097035e+11
37American Samoa2013NaN
38Andorra20133.249101e+09
\n", "
" ], "text/plain": [ " country year NY.GDP.MKTP.CD\n", "34 Afghanistan 2013 2.045894e+10\n", "35 Albania 2013 1.278103e+10\n", "36 Algeria 2013 2.097035e+11\n", "37 American Samoa 2013 NaN\n", "38 Andorra 2013 3.249101e+09" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdpCountries = gdpReset[34:]\n", "lifeCountries = lifeReset[34:]\n", "gdpCountries.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Rows with missing data are dropped." ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryyearNY.GDP.MKTP.CD
34Afghanistan20132.045894e+10
35Albania20131.278103e+10
36Algeria20132.097035e+11
38Andorra20133.249101e+09
39Angola20131.383568e+11
\n", "
" ], "text/plain": [ " country year NY.GDP.MKTP.CD\n", "34 Afghanistan 2013 2.045894e+10\n", "35 Albania 2013 1.278103e+10\n", "36 Algeria 2013 2.097035e+11\n", "38 Andorra 2013 3.249101e+09\n", "39 Angola 2013 1.383568e+11" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdpData = gdpCountries.dropna()\n", "lifeData = lifeCountries.dropna()\n", "gdpData.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The year column is discarded." ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countrySP.DYN.LE00.IN
34Afghanistan60.028268
35Albania77.537244
36Algeria74.568951
39Angola51.866171
40Antigua and Barbuda75.778659
\n", "
" ], "text/plain": [ " country SP.DYN.LE00.IN\n", "34 Afghanistan 60.028268\n", "35 Albania 77.537244\n", "36 Algeria 74.568951\n", "39 Angola 51.866171\n", "40 Antigua and Barbuda 75.778659" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "COUNTRY = 'country'\n", "headings = [COUNTRY, GDP_INDICATOR]\n", "gdpClean = gdpData[headings]\n", "headings = [COUNTRY, LIFE_INDICATOR]\n", "lifeClean = lifeData[headings]\n", "lifeClean.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Clean the population dataframe you created in Exercise 7.\n", "\n", "If in Exercise 7 you chose to directly get the population data from the World Bank instead of using the provided CSV file, you may need to remove more (or fewer) than 34 rows at the start of the dataframe due to changes done by the World Bank to its data reporting." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 9: Joining and transforming\n", "\n", "The two dataframes can now be merged with an inner join." ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryNY.GDP.MKTP.CDSP.DYN.LE00.IN
0Afghanistan2.045894e+1060.028268
1Albania1.278103e+1077.537244
2Algeria2.097035e+1174.568951
3Angola1.383568e+1151.866171
4Antigua and Barbuda1.200588e+0975.778659
\n", "
" ], "text/plain": [ " country NY.GDP.MKTP.CD SP.DYN.LE00.IN\n", "0 Afghanistan 2.045894e+10 60.028268\n", "1 Albania 1.278103e+10 77.537244\n", "2 Algeria 2.097035e+11 74.568951\n", "3 Angola 1.383568e+11 51.866171\n", "4 Antigua and Barbuda 1.200588e+09 75.778659" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gdpVsLifeAll = merge(gdpClean, lifeClean, on=COUNTRY, how='inner')\n", "gdpVsLifeAll.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The dollars are converted to million pounds." ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryNY.GDP.MKTP.CDSP.DYN.LE00.INGDP (£m)
0Afghanistan2.045894e+1060.02826813075
1Albania1.278103e+1077.5372448168
2Algeria2.097035e+1174.568951134016
3Angola1.383568e+1151.86617188420
4Antigua and Barbuda1.200588e+0975.778659767
\n", "
" ], "text/plain": [ " country NY.GDP.MKTP.CD SP.DYN.LE00.IN GDP (£m)\n", "0 Afghanistan 2.045894e+10 60.028268 13075\n", "1 Albania 1.278103e+10 77.537244 8168\n", "2 Algeria 2.097035e+11 74.568951 134016\n", "3 Angola 1.383568e+11 51.866171 88420\n", "4 Antigua and Barbuda 1.200588e+09 75.778659 767" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "GDP = 'GDP (£m)'\n", "column = gdpVsLifeAll[GDP_INDICATOR]\n", "gdpVsLifeAll[GDP] = column.apply(usdToGBP).apply(roundToMillions)\n", "gdpVsLifeAll.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The life expectancy is rounded, by applying the `round()` function." ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryNY.GDP.MKTP.CDSP.DYN.LE00.INGDP (£m)Life expectancy (years)
0Afghanistan2.045894e+1060.0282681307560
1Albania1.278103e+1077.537244816878
2Algeria2.097035e+1174.56895113401675
3Angola1.383568e+1151.8661718842052
4Antigua and Barbuda1.200588e+0975.77865976776
\n", "
" ], "text/plain": [ " country NY.GDP.MKTP.CD SP.DYN.LE00.IN GDP (£m) \\\n", "0 Afghanistan 2.045894e+10 60.028268 13075 \n", "1 Albania 1.278103e+10 77.537244 8168 \n", "2 Algeria 2.097035e+11 74.568951 134016 \n", "3 Angola 1.383568e+11 51.866171 88420 \n", "4 Antigua and Barbuda 1.200588e+09 75.778659 767 \n", "\n", " Life expectancy (years) \n", "0 60 \n", "1 78 \n", "2 75 \n", "3 52 \n", "4 76 " ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LIFE = 'Life expectancy (years)'\n", "gdpVsLifeAll[LIFE] = gdpVsLifeAll[LIFE_INDICATOR].apply(round)\n", "gdpVsLifeAll.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The original GDP and life expectancy columns are dropped." ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countryGDP (£m)Life expectancy (years)
0Afghanistan1307560
1Albania816878
2Algeria13401675
3Angola8842052
4Antigua and Barbuda76776
\n", "
" ], "text/plain": [ " country GDP (£m) Life expectancy (years)\n", "0 Afghanistan 13075 60\n", "1 Albania 8168 78\n", "2 Algeria 134016 75\n", "3 Angola 88420 52\n", "4 Antigua and Barbuda 767 76" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "headings = [COUNTRY, GDP, LIFE]\n", "gdpVsLifeClean = gdpVsLifeAll[headings]\n", "gdpVsLifeClean.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tasks\n", "\n", "1. Merge `gdpVsLifeClean` with the population dataframe obtained in the previous exercise. \n", "- Round the population value to the nearest million.\n", "- Remove the original population column." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 10: Correlation\n", "\n", "The Spearman rank correlation coefficient between GDP and life expectancy, and the corresponding p-value are calculated as follows." ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The correlation is 0.501023238967\n", "It is statistically significant.\n" ] } ], "source": [ "from scipy.stats import spearmanr\n", "\n", "gdpColumn = gdpVsLifeClean[GDP]\n", "lifeColumn = gdpVsLifeClean[LIFE]\n", "(correlation, pValue) = spearmanr(gdpColumn, lifeColumn)\n", "print('The correlation is', correlation)\n", "if pValue < 0.05:\n", " print('It is statistically significant.')\n", "else:\n", " print('It is not statistically significant.')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task\n", "\n", "Calculate the correlation between GDP and population." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 11: Scatterplots\n", "\n", "The dataframe method `plot()` can also produce scatterplots. The `logx` and `logy` arguments set a logarithmic scale on the corresponding axis." ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 40, "metadata": {}, "output_type": "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g3CRERERDKgQZiIiIhIBjQIExEREcmABmEiIiIiGdAgTERERCQD\nGoSJSNDMbMDM/tXMHjKz9WZ2m5m9qfjaCjN7yszuNLNfm9nNZvb6svd+ysy2mtmwmd1tZqfXaOON\nZvaJssdHmdktZnaXmX2/yXjPMbP3tHq8IpIfeV07UkQ6gJkZcC1wlbu/o/jcUUD5YOrn7v764mvL\ngGvNbI+731B8/RJ3v9jMXgz83MwOrbLg+HkV+/xbCj/s+AUzO6TJsL8C3EoAiwOLSNh0JUxEQnYq\nsM/dLy894e6/dfcvVtvY3YeBz1D4lezK1+4D9gOLyp83sxcBY+6+vezpY4F1xfc9WdxuhZndZGZX\nm9n9ZvZZM/tLM/uP4hWzFxS3fwb4jZm9vI3jFpEc0CBMREJ2PHBHk++5A/j9yifN7CRgEniy4qXl\nVdqYDeyrsu+lwIeAlwLvBF7k7i8HvgScW7bdOuCUJuMWkZzRIExEOoaZXWZmG8zsl/U2q3j8YTMb\nBi4G3ubT12o7jLKBmZldBgwC3yzOJVtctu0v3f0xdx8DHgR+Unz+LuDosu2eAJ4X9bhEJJ80J0xE\nQnYP8ObSA3f/gJktonirsIaXUVist+QSd7+4zvZ7gOdUtHE88BF3r2xnrOzvk2WPJ5n6fTq7uF8R\nkZp0JUxEQnYjMNvM/rrsuYNqbWxmJwAfBy5roo37gCWthVfTi4C7Y96niHQZXQkTkWC5u5vZG4FL\nzOw8CrcNdwOryzY7xczupDA4ewL4YFllZBQ3A583Myu29+88eztyD4VJ+yc1Gfpy4NNNvkdEcsam\nT48QEckXM7sU+L67/3sM+3oZ8Lfu/s72IxORbqbbkSIi8D+pc5uzSYso3BIVEalLV8JEREREMqAr\nYSIiIiIZ0CBMREREJAMahImIiIhkQIMwERERkQxoECYiIiKSAQ3CRERERDLw/wFM7gCpd3aXkAAA\nAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "gdpVsLifeClean.plot(x=GDP, y=LIFE, kind='scatter', grid=True, logx=True, figsize = (10, 4))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tasks\n", "\n", "- Swap the axes of the scatterplot, i.e. show the GDP in the y axis and the life expectancy in the x axis.\n", "- Display a scatterplot of the GDP and the population." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now go back to the course step and mark it complete.**" ] } ], "metadata": { "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.6.2" } }, "nbformat": 4, "nbformat_minor": 1 }