I would like to plot each polygon’s number within the polygon (not usually done). I am able to write the polygon names to a csv file with the following code;
import geopandas as gpd
shp = gpd.read_file("path/to/shapefile")
gdf=shp['shapeName']
gdf.to_csv("ShpNames.csv", index=False) #false, to exclude a number before the name
I have tried to get the index of each polygon and write these to csv with
gdf=shp['index']
gdf.to_csv("Shpindices.csv")
Once I get the indices, I can plot them with basemap.
Question is, is it possible to access the indices this way, or can one actually plot the indices in the shapefile. I cannot find anything, googling pandas tutorials.