Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
life_year = life_expectancy.groupby(by = ['Year', 'Status']).mean().reset_index()
Developed = life_year.loc[life_year['Status'] == 'Developed',:]
Developing = life_year.loc[life_year['Status'] == 'Developing',:]
fig1 = go.Figure()
for template in ["plotly_dark"]:
fig1.add_trace(go.Scatter(x=Developing['Year'], y=Developing['winz_Life_expectancy'],
mode='lines',
name='Developing',
marker_color='#f075c2'))
fig1.add_trace(go.Scatter(x=Developed['Year'], y=Developed['winz_Life_expectancy'],
mode='lines',
name='Developed',
marker_color='#28d2c2'))
fig1.update_layout(
height=500,
xaxis_title="Years",
yaxis_title='Life expectancy in age',
title_text='Average Life expectancy of Developing and Developed countries over the years',
template=template)
fig1.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment