Closed dwr-psandhu closed 4 months ago
Just remove the string value '4' with the number 4 in the above example and it works just fine. Same issue happens if any value in the columns is NaN, etc...
Thanks for sharing.
I think this is expected behavior since I don't expect geoviews to cast types.
However, GeoViews could raise a more descriptive error if this happens?
That’s what I meant. A better error message than the default exception would be great. So should this be moved to holoviews ??
What triggers the error is as simple as df.min()
. I'm not sure we should improve the error message, the data is bad and therefore the exception is bad. Maybe we could catch the error in geopandas.py:287
, and make it nans but that could give weird side effects.
For the np.nan
case we do emit a warning:
WARNING:param.project_points: While projecting a Points element from a PlateCarree coordinate reference system (crs) to a Mercator projection none of the projected paths were contained within the bounds specified by the projection. Ensure you have specified the correct coordinate system for your data.
@Hoxbro I guess I don't understand why ranges would matter on non-numeric columns. So in the case of df.min there is an option to numeric_only
df.min(numeric_only=True)
doesn't calculate it for the non-numeric column.
It calculates the ranges of the element dimensions, and for gv.Points
, all of the columns are used.
Also, it seems to set the p.kdims to longitude + latitude, which seems weird to me. When they are not in the data.
Versions of relevant libraries (python 3.11 env)
bokeh 3.3.4 pyhd8ed1ab_0 conda-forge geopandas 0.14.3 pyhd8ed1ab_0 conda-forge geopandas-base 0.14.3 pyha770c72_0 conda-forge geoviews 1.11.1 pyhd8ed1ab_0 conda-forge geoviews-core 1.11.1 pyha770c72_0 conda-forge holoviews 1.18.3 pyhd8ed1ab_0 conda-forge
Unncessary calculation of range on columns
geopandas array with many columns some of which of items that are not comparable (i.e. different types or Nans)
Example
Stack traceback and/or browser JavaScript console output