Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
status_life_exp = life_expectancy.groupby(by=['Status']).mean().reset_index().sort_values('winz_Life_expectancy',ascending=False).reset_index(drop=True)
plt.figure(figsize=(20,10))
fig = px.bar(status_life_exp, x='Status', y='winz_Life_expectancy',color='winz_Life_expectancy')
fig.update_layout(
title="Life expectancy according to status",
xaxis_title="Status",
yaxis_title="Average Life Expectancy",
font=dict(
family="Courier New",
size=16,
color="black"
)
)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment