import geopandas as gpd
import geoplot as gplt
# Load the json file with county coordinates
geoData = gpd.read_file('https://raw.githubusercontent.com/holtzy/The-Python-Graph-Gallery/master/static/data/US-counties.geojson')
# Make sure the "id" column is an integer
geoData.id = geoData.id.astype(str).astype(int)
# Remove Alaska, Hawaii and Puerto Rico.
stateToRemove = ['02', '15', '72']
geoData = geoData[~geoData.STATE.isin(stateToRemove)]
# Basic plot with just county outlines
gplt.polyplot(geoData, figsize=(20, 4))
leads to:
AttributeError: 'MultiPolygon' object has no attribute 'exterior'
in https://python-graph-gallery.com/choropleth-map-geopandas-python/
leads to:
AttributeError: 'MultiPolygon' object has no attribute 'exterior'