14 lines
392 B
Python
14 lines
392 B
Python
import plotly.express as px
|
|
import pycountry
|
|
|
|
df = px.data.gapminder().query("year==2007")
|
|
|
|
print(df.head())
|
|
|
|
fig = px.choropleth(df, locations="iso_alpha",
|
|
color="lifeExp", # lifeExp is a column of gapminder
|
|
hover_name="country", # column to add to hover information
|
|
color_continuous_scale=px.colors.sequential.Plasma)
|
|
|
|
fig.show()
|