Creating choropleth map with Polygons

I am trying to make a choropleth map like the Texas choropleth example for my own country, but have been struggling with it for days.
I get: ValueError: All value dimensions on a Contours element must be scalar

I have a shape file, and tried to convert it to geojson, but that does not help.

Then tried extracting longitudes and latitudes from GeoPandas shape file:

So that I can try this: hv.Polygons(geodata, ['LON', 'LAT'])

but get: ValueError: All value dimensions on a Contours element must be scalar

What format should the input file be? and is it possible to convert my shape file, og is it best to get new data in another format?

Do you have GeoViews installed? It ships with a geopandas interface which will allow you to use your dataframe as is. So without specifying any key dimensions you should be able to do hv.Polygons(geodata) or gv.Polygons(geodata).

1 Like