{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# **Lab4: Data Visualization**\n",
"\n",
"**Course**: **INF-604: Data Analysis**
\n",
"**Lecturer**: **Sothea HAS, PhD**\n",
"\n",
"-----\n",
"\n",
"**Objective:** In this lab, you will apply the data visualization techniques you have studied to a real dataset. Each graph you create should be easy to understand and complete, including a title, legend, and other information to help the audience comprehend them easily. Effective graphs shouldn't take longer than 15 seconds for viewers to understand.\n",
"\n",
"- The `notebook` of this `Lab` can be downloaded here: [Lab4_Data_Visualization.ipynb](https://hassothea.github.io/Data_Analysis_AUPP/Labs/Lab4_Data_Visualization.ipynb).\n",
"\n",
"- Or you can work directly with `Google Colab` here: [Lab4_Data_Visualization.ipynb](https://colab.research.google.com/drive/1SJ0Ft43NerqXn5fXUhJY6vHOrom96dF1?usp=sharing).\n",
"\n",
"\n",
"-----\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1. `Gapminder` dataset\n",
"\n",
"[`Gapminder`](https://pypi.org/project/gapminder/) is an excerpt of data available at [https://gapminder.org](https://www.gapminder.org/). For each of $142$ countries (`country`), the package provides values for life expectancy (`lifeExp`), GDP per capita (`gdpPercap`), and population (`pop`), every five years, from $1952$ to $2007$ (`year`). It is initially used in [Jennifer Bryan's excellent `gapminder` teaching package for R](https://github.com/jennybc/gapminder/) ([`ggplot`](https://ggplot2.tidyverse.org/), [`tidyverse`](https://www.tidyverse.org/), and more). For more information about `gapminder`: \n",
"\n",
"- Documentation: [https://www.gapminder.org/data/documentation/](https://www.gapminder.org/data/documentation/)\n",
"- A short demonstration video is available here: [Hans Rosling's 200 Countries, 200 Years, 4 Minutes - The Joy of Stats - BBC Four](https://youtu.be/jbkSRLYSojo?si=qipg08VIi999hEgo)."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Number of observations: 1704\n"
]
},
{
"data": {
"text/html": [
"
\n", " | country | \n", "continent | \n", "year | \n", "lifeExp | \n", "pop | \n", "gdpPercap | \n", "
---|---|---|---|---|---|---|
1424 | \n", "Spain | \n", "Europe | \n", "1992 | \n", "77.570 | \n", "39549438 | \n", "18603.064520 | \n", "
269 | \n", "Chad | \n", "Africa | \n", "1977 | \n", "47.383 | \n", "4388260 | \n", "1133.984950 | \n", "
135 | \n", "Bolivia | \n", "Americas | \n", "1967 | \n", "45.032 | \n", "4040665 | \n", "2586.886053 | \n", "