holoviz-topics / examples

Visualization-focused examples of using HoloViz for specific topics
https://examples.holoviz.org
Creative Commons Attribution 4.0 International
82 stars 24 forks source link

Gerrymandering notebook gives error when running hvplot of shape data cell #410

Closed hsparra closed 1 month ago

hsparra commented 1 month ago

On the Gerrymandering notebook, https://examples.holoviz.org/gallery/gerrymandering/gerrymandering.html, I run into an error when I run the cell with:

districts = gdf_districts.hvplot.polygons(geo=True, project=True, color=None) districts The error:

DataError: Supplied data does not contain specified dimensions, the following dimensions were not found: ['Longitude', 'Latitude']

PandasInterface expects tabular data, for more information on supported datatypes see http://holoviews.org/user_guide/Tabular_Datasets.html Has something changed with hvplot since the notebook was created? I am using the shapefile with the same name found on the US Census site. The data does have a geometry column with polygon objects but no Latitude or Longitude columns.

ALL software version info hvplot 0.10.0 holoviews 1.18.3 bokeh 3.2.2 geopandas 0.14.2 geopandas-base 0.14.2 python 3.12.4

Description of expected behavior and the observed behavior Observed behavior: See above Expected behavior: shapes of US congressional districts displayed

Note: The error also occurs on the hvplot Geographical Data notebook: https://hvplot.holoviz.org/user_guide/Geographic_Data.html#

@droumis

droumis commented 1 month ago

I just did a fresh install of the gerrymandering example and I cannot reproduce your error. Did you follow the getting started instructions for the examples? Running anaconda-project will download the correct data.

My versions:

Versions ```bash Python : 3.11.9 (main, Apr 19 2024, 11:43:47) [Clang 14.0.6 ] Operating system : macOS-13.5.2-arm64-arm-64bit Panel comms : default holoviews : 1.18.3 bokeh : 3.4.0 colorcet : 3.1.0 cudf : - dask : 2024.5.0 datashader : 0.16.0 geoviews : 1.12.0 hvplot : 0.10.0 ibis-framework : - IPython : 8.20.0 jupyter_bokeh : - jupyterlab : 4.0.11 matplotlib : 3.8.4 networkx : 3.1 notebook : 7.0.8 numba : 0.59.1 numpy : 1.26.4 pandas : 2.2.1 panel : 1.4.2 param : 2.1.0 pillow : 10.3.0 plotly : - pyarrow : 14.0.2 pyviz_comms : 3.0.2 scikit-image : - scipy : 1.13.0 spatialpandas : - streamz : - tsdownsample : - xarray : 2023.6.0 ```
hsparra commented 1 month ago

I ran it on an environment I had with all the packages. It runs find with python 3.10. Must be something related to python 3.12.

Closing since you cannot reproduce.

hsparra commented 1 month ago

Closing since others could not reproduce.