Skip to content

Dataset used in example on scatter plots page is removed in geopandas 1.0 #4778

Open
@LiamConnors

Description

@LiamConnors
Member

This example here won't run with later versions of geopandas

https://plotly.com/python/scatter-plots-on-maps/#basic-example-with-geopandas

import plotly.express as px
import geopandas as gpd

geo_df = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))

px.set_mapbox_access_token(open(".mapbox_token").read())
fig = px.scatter_geo(geo_df,
                    lat=geo_df.geometry.y,
                    lon=geo_df.geometry.x,
                    hover_name="name")
fig.show()
     20     error_msg = (
     21         "The geopandas.dataset has been deprecated and "
     22         "was removed in GeoPandas 1.0. New sample datasets are now available "
     23         "in the geodatasets package (https://geodatasets.readthedocs.io/en/latest/)"
     24     )

It would be good to have an example that works with earlier and later versions of geopandas

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @LiamConnors@live2awesome

      Issue actions

        Dataset used in example on scatter plots page is removed in geopandas 1.0 · Issue #4778 · plotly/plotly.py