Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 6, 2021 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/30c3ad9055b614b0417e7110ec7a987f to your computer and use it in GitHub Desktop.
Save amankharwal/30c3ad9055b614b0417e7110ec7a987f to your computer and use it in GitHub Desktop.
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