df.describe().round(2)
df1.describe().round(2)
Relationship between capital-labour ratio and total factor productivity in African countries
df1['log_tfp'].describe()
Scatter plot
px.scatter(df1, x = 'kl', y = 'log_tfp', color = 'country', hover_name= 'country')
Histogram - Capital-labour ratio of African countries
px.histogram(df1, x = 'kl', hover_name= 'country', color= 'hi1990', marginal='box')
How has labour productivity contributed to GDP per capita in African countries?
df2 = df1[['country', 'year', 'region', 'pop', 'hi1990','kl', 'GDPpc', 'log_lp', 'log_GDPpc','log_ky', 'log_h', 's', 'log_tfp','isocode']]
df2
Scatter plot
px.scatter(df2, #dataframe
x = "log_lp", #x-values column
y = "log_GDPpc", #y-values column
animation_frame = "year", #column animated
animation_group = "country", #column shown as bubble
size = "pop", #column shown by size
color = "country", #column shown by color
hover_name = "country", #hover info title
log_x = True, #use logs on x-values
size_max = 55, #change max size of bubbles
range_x = [6,15], #axis range for x-values
range_y = [3,12] #axis range for y-values
)
fig = px.choropleth(df2, #dataframe
locations = 'isocode', #location code
color = 'GDPpc', #column shown by color
hover_name = 'country', #hover info title
animation_frame = 'year', #column animated
range_color = [3,5000] #color range
)
fig.show()
GDP per capita for African countries in 2014
df2.query("year == 2014")
fig = px.treemap(df2, path=[px.Constant("continent"), 'country'],
color='GDPpc', hover_data=['country'],
color_continuous_scale='emrld')
fig.show()
Labour-productivity for African countries in 2014
df2.query("year == 2014")
fig = px.sunburst(df2, path=['country'], values='pop',
color='log_lp', hover_data=['isocode'],
color_continuous_scale='emrld',
color_continuous_midpoint=np.average(df2['log_lp'], weights=df2['pop']))
fig.show()