-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update geopandas example #4782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update geopandas example #4782
Conversation
Thanks @sarthak-12 for the PR!
geodatasets
might work for both versions. If so, we could get rid of the if/else
But we also may need to look at the datasets available on geodatasets
and see if they are accessible in the same way.
df = gpd.read_file(geodatasets.get_path('naturalearth_cities'))
returns the following for me
raise ValueError(f"No matching item found for the query '{name}'.")
ValueError: No matching item found for the query 'naturalearth_cities'
It looks like the geopandas team simultaneously separated data sets into a separate project and removed the cities data set from their example library
The data appear to be available here: https://www.naturalearthdata.com/downloads/110m-cultural-vectors/
specifically, I think, here: http//www.naturalearthdata.com/download/110m/cultural/ne_110m_populated_places_simple.zip
if this code needs a file inside that zip, would you want it committed to the plotly data repo?
It looks like the geopandas team simultaneously separated data sets into a separate project and removed the cities data set from their example library
The data appear to be available here: https://www.naturalearthdata.com/downloads/110m-cultural-vectors/ specifically, I think, here: http//www.naturalearthdata.com/download/110m/cultural/ne_110m_populated_places_simple.zip
if this code needs a file inside that zip, would you want it committed to the plotly data repo?
Thanks @rl-utility-man
I think we could avoid committing the zip file. It looks like something like this would just work:
geo_df = gpd.read_file("https://naciscdn.org/naturalearth/110m/cultural/ne_110m_populated_places_simple.zip")
What do you think?
if gpd.read_file() just works on a ZIP, I like this solution. If we'd have to clutter the codebase with downloading and unzipping and need to deal with potential differences in the local file system, then perhaps putting a small geopandas point data set in the data repo would be cleaner. I feel no deep expertise or strong opinions here; I just hoped my prior comment would provide some context to move this toward a resolution.
Please uncomment this block and take a look at this checklist if your PR is making substantial changes to documentation/impacts files in the
doc
directory. Check all that apply to your PR, and leave the rest unchecked to discuss with your reviewer! Not all boxes must be checked for every PR :)If your PR modifies code of the
plotly
package, we have a different checklistbelow :-).
Documentation PR
doc/README.md
filedoc-prod
branch OR it targets themaster
branchpx
example if at all possibleplotly.graph_objects as go
/plotly.express as px
/plotly.io as pio
df
fig = <something>
call is high up in each new/modified example (eitherpx.<something>
ormake_subplots
orgo.Figure
)fig.add_*
andfig.update_*
rather thango.Figure(data=..., layout=...)
in every new/modified examplefig.add_shape
andfig.update_xaxes
are used instead of bigfig.update_layout
calls in every new/modified examplefig.show()
is at the end of each new/modified exampleplotly.plot()
andplotly.iplot()
are not used in any new/modified exampleCode PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).
Notes:
projection="natural earth"
to avoid the need for a Mapbox access token.Testing:
Related Issues:
Let me know if there are any questions or if further changes are needed.