Created
February 21, 2020 06:45
-
-
Save databyjp/cff165518390911f7a0753458e33f19e to your computer and use it in GitHub Desktop.
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
# ========== ADD CAPACITY & AGE ========== | |
from datetime import datetime | |
cur_yr = datetime.today().year | |
arena_df = arena_df.assign(age=(cur_yr-arena_df.opened)) | |
arena_df = arena_df.assign(capacity=arena_df.capacity.str.replace(',','').astype(int)) | |
fig = px.scatter_mapbox( | |
arena_df, lat="lat", lon="lon", zoom=3, size='capacity', color='age', size_max=15, hover_name='teamname') | |
fig.update_layout(mapbox_style="light", mapbox_accesstoken=mapbox_key) # <== Using Mapbox | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment