<jupyter_start><jupyter_text>World Development Indicators dataset<jupyter_code># Data Source: https://www.kaggle.com/worldbank/world-development-indicators
# Folder: 'world-development-indicators'
#import necessary libraries
import pandas as pd
import matplotlib.pyplot as plt
#load the data
data=pd.read_csv('Indicators.csv')
data.shape
data.head()
data['CountryName'].unique().tolist()
data['IndicatorName'].unique().tolist()
data['IndicatorName'].str.contains('GDP per capita').value_counts()
data_2014=data[data['IndicatorName']=='GDP at market prices (constant 2005 US$)']
data_2014=data_2014[data_2014['Year']==2014]
data_2014.sort_values(by='Value',ascending=False)
data.head()
mask_agr=data['IndicatorName']=='Employment in agriculture (% of total employment)'
mask_ind=data['IndicatorName']=='Employment in industry (% of total employment)'
mask_ser=data['IndicatorName']=='Employment in services (% of total employment)'
mask_US=data['CountryName']=='United States'
mask_Chi=data['CountryName']=='China'
mask_Jap=data['CountryName']=='Japan'
US_agr=data[mask_agr & mask_US]
print(US_agr['Year'].min(),len(US_agr) ,US_agr['Year'].max())
US_ind=data[mask_ind & mask_US]
print(US_ind['Year'].min(),len(US_ind) ,US_ind['Year'].max())
US_ser=data[mask_ser & mask_US]
print(US_ser['Year'].min(),len(US_ser) ,US_ser['Year'].max())
Chi_agr=data[mask_agr & mask_Chi]
print(Chi_agr['Year'].min(),len(Chi_agr) ,Chi_agr['Year'].max())
Chi_ind=data[mask_ind & mask_Chi]
print(Chi_ind['Year'].min(),len(Chi_ind) ,Chi_ind['Year'].max())
Chi_ser=data[mask_ser & mask_Chi]
print(Chi_ser['Year'].min(),len(Chi_ser) ,Chi_ser['Year'].max())
Jap_agr=data[mask_agr & mask_Jap]
print(Jap_agr['Year'].min(),len(Jap_agr) ,Jap_agr['Year'].max())
Jap_ind=data[mask_ind & mask_Jap]
print(Jap_ind['Year'].min(),len(Jap_ind) ,Jap_ind['Year'].max())
Jap_ser=data[mask_ser & mask_Jap]
print(Jap_ser['Year'].min(),len(Jap_ser) ,Jap_ser['Year'].max())

plt.plot(Jap_ser['Year'].values, Jap_ser['Value'].values,label='Services %')
plt.plot(Jap_ind['Year'].values, Jap_ind['Value'].values,label='Industry %')
plt.plot(Jap_agr['Year'].values, Jap_agr['Value'].values,label='Agriculture %')
plt.xlabel('Year')
plt.ylabel('Employment share')
plt.title('Evolution of employment share in Japan')
plt.legend(loc=2)
plt.show()
plt.plot(US_ser['Year'].values, US_ser['Value'].values,label='Services %')
plt.plot(US_agr['Year'].values, US_agr['Value'].values, label='Agriculture %')
plt.plot(US_ind['Year'].values, US_ind['Value'].values,label='Industry %')
plt.xlabel('Year')
plt.ylabel('Employment share')
plt.title('Evolution of employment share in US')
plt.legend(loc=0)
plt.show()
plt.plot(Chi_ser['Year'].values, Chi_ser['Value'].values,label='Services %')
plt.plot(Chi_agr['Year'].values, Chi_agr['Value'].values, label='Agriculture %')
plt.plot(Chi_ind['Year'].values, Chi_ind['Value'].values,label='Industry %')
plt.xlabel('Year')
plt.ylabel('Employment share')
plt.title('Evolution of employment share in China')
plt.legend(loc=0)
plt.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup