Automating-GIS-processes/site

Error while reading shapefile with geopandas

Closed this issue · 2 comments

my commands are as follows:

import geopandas as gp
fl=r"M:/rathore/vic_5km/L2_data/L2_data/DAMSELFISH_distributions.shp"
data=gp.read_file(Path('M:/rathore/vic_5km/L2_data/L2_data/DAMSELFISH_distributions.shp').resolve())

The 3rd commands gives the following error:

TypeError: invalid path: UnparsedPath(path='M:/rathore/vic_5km/L2_data/L2_data/DAMSELFISH_distributions.shp')

I have tried to change the / to \\ but its still there.

@lokendrarathore Sorry for taking this long to answer. Did you manage to fix this issue?

Your code has some things going on that I am not totally sure what might be the issue. What is this Path() object doing? Are you reading the file from some network drive or something?

I am closing this now, please check the latest course materials for input data and syntax :)