I am trying to open a shapefile with Jupyter notebook, but I can't get it to open. The shapefile is located in the same folder as my workbook, and Python can't identify it even if I use the full path.
import shapefile as shp import matplotlib.pyplot as plt sf = shp.Reader(r'C:\Users\Public\Documents\1-11-99n.shp')
ShapefileException: Unable to open C:\Users\Public\Documents\1-11-99n.dbf or C:\Users\Public\Documents\1-11-99n.shp.
Opening it with fiona and geopandas does not work either.
import fiona shape = fiona.open("1-11-99n.shp")
import geopandas as gp shp = gp.GeoDataFrame.from_file('1-11-99n.shp') print (shp)
both end up with
CPLE_OpenFailedError: b'Unable to open 1-11-99n.shx or 1-11-99n.SHX.Try --config SHAPE_RESTORE_SHX true to restore or create it'
I know this might be a trivial issue, but I am new to using shapefiles and spatial Python libraries so I really don't know how to work around this issue.