GeoPandas Shapefile – Reading N Number of Rows from Shapefile Using GeoPandas

data-framegeopandasshapefile

Pandas has a parameter nrows for selecting how many rows will be read into the DataFrame.

Does GeoPandas have a similar parameter? Couldn't find in the documentation.

Best Answer

See Only read specific rows of a shapefile with GeoPandas / Fiona:

import geopandas as gpd
import fiona

c = fiona.open(r'C:\someshapefile.shp')
df = gpd.GeoDataFrame.from_features(c[0:5])