<jupyter_start><jupyter_text>**Import data commands and HDI data**<jupyter_code>#Upload HDI Data 
from google.colab import files
uploaded = files.upload()
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np<jupyter_output><empty_output><jupyter_text>**Importing HDI Cleaned Dataset**<jupyter_code>data = "3. HDI_cleaned.csv"
dataHDI = pd.read_csv(data, index_col=0, encoding='latin1')
dataHDI.head()
#For some reason, HDI values were object types, so must convert values to float type in order to get summary stats
dataHDI = pd.DataFrame(dataHDI)

for k in list(dataHDI):
  dataHDI[k]=pd.to_numeric(dataHDI[k], errors='coerce')

dataHDI.dtypes<jupyter_output><empty_output><jupyter_text>**Summary Statistics: World HDI Data**<jupyter_code>world = dataHDI.describe()
world<jupyter_output><empty_output><jupyter_text>**Creating Dataframe with only African countries**<jupyter_code>#Upload Africa_FULL_MERGE data
from google.colab import files
uploaded = files.upload()
data2 = "Africa_FULL_MERGE.csv"
dataHDI_Africa = pd.read_csv(data2, index_col=0, encoding='latin1')
dataHDI_Africa.head()
#narrowing table down to HDI data
dataHDI_Africa = dataHDI_Africa[['Country', 'Year', 'Region', 'HDI','HDI Rank (2018)']]
dataHDI_Africa.head()
#narrowing down timeframe as HDI data recorded mainly between 1975-2018
dataHDI_Africa = dataHDI_Africa[dataHDI_Africa['Year'] <= 2018]
dataHDI_Africa = dataHDI_Africa[dataHDI_Africa['Year'] >= 1975]
dataHDI_Africa.reset_index(drop=True)
dataHDI_Africa
#saving new file
dataHDI_Africa.to_csv('HDI Africa.csv')<jupyter_output><empty_output><jupyter_text>**Summary Statistics: Africa HDI Data**<jupyter_code>#Again must convert HDI values of object types to float type in order to get summary stats
dataHDI_Africa = pd.DataFrame(dataHDI_Africa)


dataHDI_Africa['HDI']=pd.to_numeric(dataHDI_Africa['HDI'], errors='coerce')
dataHDI_Africa['HDI Rank (2018)']=pd.to_numeric(dataHDI_Africa['HDI Rank (2018)'], errors='coerce')

dataHDI_Africa.dtypes
dataHDI_Africa.describe()
#Most recently in 2018, Mean World HDI is 0.713, while for the African continent it is 0.551

dataHDI_2018 = dataHDI_Africa[dataHDI_Africa['Year'] == 2018]
dataHDI_2018 = dataHDI_2018.reset_index(drop=True)
dataHDI_2018 = dataHDI_2018[['Country', 'Year', 'HDI', 'HDI Rank (2018)']]
dataHDI_2018
dataHDI_2018.describe()<jupyter_output><empty_output><jupyter_text>**Niger Statistics**<jupyter_code>dataHDI_Niger = dataHDI_Africa[dataHDI_Africa['Country'] == 'Niger']
dataHDI_Niger = dataHDI_Niger.reset_index(drop=True)
dataHDI_Niger = dataHDI_Niger[['Country', 'Year', 'HDI', 'HDI Rank (2018)']]
dataHDI_Niger
dataHDI_Niger.describe()<jupyter_output><empty_output><jupyter_text>**Tunisia Statistics**<jupyter_code>dataHDI_Tunisia = dataHDI_Africa[dataHDI_Africa['Country'] == 'Tunisia']
dataHDI_Tunisia = dataHDI_Tunisia.reset_index(drop=True)
dataHDI_Tunisia = dataHDI_Tunisia[['Country', 'Year', 'HDI', 'HDI Rank (2018)']]
dataHDI_Tunisia
dataHDI_Tunisia.describe()
#Mean Niger HDI is 0.28, while for Tunisia it is 0.67. Niger's HDI is almost half Tunisia's, showing how it has lower HDI and high TFR<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12242308912147161, 'fraction_numerical': 0.030764351411354265, 'mean_word_length': 8.918238993710691, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, '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': '618877', 'license': 'MIT', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1201, 'n_words': 246, 'path': 'Python Analysis/ HDI_Descriptive_Data.ipynb', 'repo_name': 'ChangHuaHua/QM2-Group-12', 'size': '3153'}