Last active
June 2, 2020 12:49
-
-
Save dsibi/0d30b0df1d3e2b54afa77977818dbb9d to your computer and use it in GitHub Desktop.
Meteors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objs as go | |
import pandas as pd | |
rows=[['501-600','15','122.58333','45.36667'], | |
['till 500','4','12.5','27.5'], | |
['more 1001','41','-115.53333','38.08'], | |
] | |
colmns=['bins','data','longitude','latitude'] | |
df=pd.DataFrame(data=rows, columns=colmns) | |
df = df.astype({"data": int}) | |
fig = go.Figure(data=go.Scattergeo( | |
lon = df['longitude'], | |
lat = df['latitude'], | |
mode = 'markers', | |
marker_color = df.index, | |
marker_size=df['data'], | |
customdata = df, | |
hovertemplate="<b>%{customdata[0]} </b><br><br>blablabla: %{customdata[1]: .3f}<extra></extra>" | |
)) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment