Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created May 18, 2021
Embed
What would you like to do?
# Choropleth Maps
import plotly.graph_objects as go
import pandas as pd
data = pd.read_csv("https://raw.githubusercontent.com/amankharwal/Website-data/master/usa.csv")
figure = go.Figure(data=go.Choropleth(locations=data["code"],
z = data["total exports"].astype(float),
locationmode="USA-states",
colorscale="Reds",
colorbar_title="Millions USD"))
figure.update_layout(title_text="US Agriculture Exports", geo_scope='usa')
figure.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment