Strange hover values for lon/lat in pandas data

I’m getting some strange values displayed by hover for lon,lat float32 values in a Pandas dataframe, see cells [7],[8] in this reproducible notebook

The dataframe looks like:

                 lon        lat
mooring                        
10071sc-a -69.357803  43.714802
10081sc-a -68.108704  44.105801
10091sc-a -70.427803  43.180698
10341sc-a -69.354797  43.715801
10431sc-a -70.565697  42.521702

but what you see in the hover is:

Is this bug or user error?

Try

df['lon']= df['lon'].astype(float)
df['lat']= df['lat'].astype(float)
df.head()

Or update hvplot maybe

I get the same problem using float (which creates float64) as with float32.

My hvplot version is 0.7.3. Does it work for you?

Yes it looks fine to me; no changes to code

import holoviews as hv
import geoviews as gv

print(
    hvplot.__version__,
    hv.__version__,
    gv.__version__,
)

0.7.3 1.14.5 1.9.1

Ah, interesting! I have geopandas 1.9.1 installed, but when I do:

 print(
    hvplot.__version__,
    hv.__version__,
    gv.__version__,
)

I get back:

0.7.3 1.14.5 0.0.0+g19602f53-gitarchive

I guess that is due to this issue, but I don’t understand why your gv.__version__ is different.

Regardless, I’m still getting the incorrect lon/lat values on hover and you are not!

Here’s my full holoviz version stuff:

conda list | grep -E 'holoviews|geoviews|hvplot|bokeh|pandas|datashader'

bokeh                     2.2.3            py39hf3d152e_0    conda-forge
bokeh-root-cmd            0.1.1              pyhd8ed1ab_0    conda-forge
datashader                0.13.0             pyh6c4a22f_0    conda-forge
geopandas                 0.9.0              pyhd8ed1ab_1    conda-forge
geopandas-base            0.9.0              pyhd8ed1ab_1    conda-forge
geoviews                  1.8.2                      py_0    conda-forge
geoviews-core             1.8.2                      py_0    conda-forge
holoviews                 1.14.5             pyhd8ed1ab_0    conda-forge
hvplot                    0.7.3              pyh6c4a22f_0    conda-forge
intake-geopandas          0.3.0              pyhd8ed1ab_0    conda-forge
pandas                    1.3.2            py39hde0f152_0    conda-forge
spatialpandas             0.4.3              pyhd8ed1ab_0    conda-forge

@ahuang11, what is your output from this command?

conda list | grep -E 'holoviews|geoviews|hvplot|bokeh|pandas|datashader'

Solved. I needed to unpin (upgrade) bokeh from 2.2.3 to 2.3+.
When I first tried upgrading bokeh to 2.3, I didn’t get anything displaying, then remembered @philippjfr saying when that happens I should try opening an incognito tab. Sure enough, something was being cached, and when I blew my browser cache and cookies away it worked fine:

This is good news. That means Holoviz works with the latest versions of everything on conda-forge work – no pinning necessary!

Here’s what my environment now looks like:

conda list | grep -E 'holoviews|geoviews|hvplot|bokeh|pandas|datashader'

bokeh                     2.3.3            py39hf3d152e_0    conda-forge
bokeh-root-cmd            0.1.1              pyhd8ed1ab_0    conda-forge
datashader                0.13.0             pyh6c4a22f_0    conda-forge
geopandas                 0.9.0              pyhd8ed1ab_1    conda-forge
geopandas-base            0.9.0              pyhd8ed1ab_1    conda-forge
geoviews                  1.9.1              pyhd8ed1ab_1    conda-forge
geoviews-core             1.9.1              pyha770c72_1    conda-forge
holoviews                 1.14.5             pyhd8ed1ab_0    conda-forge
hvplot                    0.7.3              pyh6c4a22f_0    conda-forge
intake-geopandas          0.3.0              pyhd8ed1ab_0    conda-forge
pandas                    1.3.2            py39hde0f152_0    conda-forge
spatialpandas             0.4.3              pyhd8ed1ab_0    conda-forge
1 Like