<jupyter_start><jupyter_text>Processing of tabular data  __Import Statements__<jupyter_code>%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Research question>  How does the population change over time in Germany, France and Italy?  Read the dataThe data is obtained form [Global Health Data Exchange](http://ghdx.healthdata.org/), the world’s most comprehensive catalog of surveys, censuses, vital statistics, and other health-related data.  __Read__ `.csv` __file__<jupyter_code>pop = pd.read_csv("../data/IHME_GBD_2016_POPULATION_ESTIMATES_1990_2016_Y2017M09D14.CSV")
pop<jupyter_output><empty_output><jupyter_text>Inspect the data __Columns__<jupyter_code>pop.columns<jupyter_output><empty_output><jupyter_text>Exploratory Data Analysis<jupyter_code>pop.location_name.nunique()
pop.location_name.sample(10)
pop.sex_name.unique()
pop.age_group_name.unique()<jupyter_output><empty_output><jupyter_text>Analyzing a subset of the dataset __Subsetting__<jupyter_code>ages = ['5-14 years', '15-49 years', '50-69 years','70+ years']
location = ["Germany", "France", "Italy"]
sex = ['Male', 'Female']
cond = (
    pop.age_group_name.isin(ages) & 
    pop.location_name.isin(location) & 
    pop.sex_name.isin(sex)
)
pop_subset = pop.loc[cond,:]
print(pop_subset.shape)
pop_subset.sample(5)<jupyter_output><empty_output><jupyter_text>Split-Apply-Combine ![](_img/split-apply-combine.png)Image source: [Jake VanderPlas 2016, Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/) **Question: How did the population of Germany, Italy and France change over time?**<jupyter_code>gb = pop_subset.groupby(["year_id", "location_name"])["pop"].sum()
gb<jupyter_output><empty_output><jupyter_text>Plotting<jupyter_code>gb.unstack().plot(figsize=(14,4))
plt.grid()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1280128548473487, 'fraction_numerical': 0.023031601499732192, 'mean_word_length': 8.293532338308458, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '588103', 'license': 'RSA-MD', 'n_tokens_mistral': 705, 'n_tokens_neox': 653, 'n_words': 119, 'path': 'notebooks/03_A simple data analysis.ipynb', 'repo_name': 'eotp/dgoev19', 'size': '1867'}