text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

pop = pd.read_csv('../input/vietnam-population-dgp-education-data/pop.csv')
edu = pd.read_csv('../input/vietnam-population-dgp-education-data/Vietnamstudent.csv')
gdp = pd.read_csv('../input/vietnam-population-dgp-education-data/GDPcompare.csv')
pisa = pd.read_csv('../input/vietnam-population-dgp-education-data/Pisa_GDP.csv')

sns.set_style('whitegrid')
gdp = gdp.query('Year >= 1990')
fig,ax = plt.subplots(figsize = (10,7))
rapid_year = [2015,2010,2019]
gdp['color_cats'] = ['blue' if x in rapid_year else 'red' for x in gdp['Year']]
ax.bar (gdp['Year'],gdp['Vietnam'], color = gdp['color_cats'], alpha = 0.5)
ax2 = ax.twinx()
ax2.plot( gdp['Year'], gdp['Vietnam GDP PPP'])

ax.set_ylabel('GDP - Hundered Billion USD')
ax2.set_ylabel('GDP per person - USD')
ax.set_title('Vietnam GDP and GDP PPP 1990 - 2019', size =14)

fig, ax = plt.subplots(figsize =(10,7))
ax.plot(gdp['Year'], gdp['Indonesia %'], color = 'Blue', alpha = 0.3)
ax.plot(gdp['Year'], gdp['Malatsia %'], color = 'Green', alpha = 0.3)
ax.plot(gdp['Year'], gdp['Thailand %'], color = 'Gray', alpha = 0.3)
ax.plot(gdp['Year'], gdp['Singapore %'], color = 'Yellow', alpha = 0.3)
ax.plot(gdp['Year'], gdp['Vietnam %'], color = 'Red')
ax.set_xlabel('Year')
ax.set_ylabel('GDP Growth %')
ax.set_title('Vietnam and some other countries in SEA GDP growth rate', y = 1.1, size = 14)
ax.legend(['Indonesia','Malaysia','Thailand','Singapore','Vietnam'])
plt.show()

X = np.array([pop['Newborn']])
Y = pop.index.tolist()
P = []
K = []

pop.shape

pg = pop.query('Year >= 1990')

fig, ax = plt.subplots(figsize = (10,7))
ax.bar(pg['Year'], pg['Urbanpop'], alpha = 0.4)
ax.bar(pg['Year'], pg['Rural Population'], bottom = pg['Urbanpop'], color = 'Green', alpha = 0.4)
ax.legend(['Urbanpop','Ruralpop'])
ax.set_xlabel('Year')
ax.set_ylabel('Total population x 100 millions')

fig, ax = plt.subplots(figsize = (10,7))
ax.bar(pg['Year'], pg['Urbanpop'], alpha = 0.4)
ax.bar(pg['Year'], pg['Rural Population'], bottom = pg['Urbanpop'], color = 'Gray', alpha = 0.4)
ax.legend(['Urbanpop','Ruralpop'])
ax.set_xlabel('Year')
ax.set_ylabel('Total population x 100 millions')

ax2 = ax.twinx()

ax2.plot(pg['Year'], pg['Population growth %'])
ax2.set_ylabel ('% Population Growth')
plt.show()

pdu = pd.merge(pg, edu, on='Year')

pdu1 = pdu.query('Year>=2002')

fig, ax = plt.subplots(figsize = (10, 7))
ax.bar(pdu1['Year'], pdu1['6_10yo'], alpha = 0.4)
ax.bar(pdu1['Year'], pdu1['Primary'], alpha = 0.4)

ax.set_ylabel('Millions people')
ax.set_title('Number of 6-10 years old children and Primary students in Vietnam', y = 1.1, size = 14)
ax.legend(['6-10 years old','Primary student'])

fig, ax = plt.subplots(figsize=(10, 7))
ax.bar(pdu1['Year'], pdu1['6_18yo'], alpha=0.4)
ax.bar(pdu1['Year'], pdu1['K-12'], alpha=0.4)
ax.set_ylabel('Millions people')
ax.set_title('Population in 16 - 18 years old and K-12 students', y=1.1, size=14)
ax.legend(['6-18 yo', 'K-12'])
plt.show()