Skip to main content
3 of 3
deleted 4 characters in body

Geopandas 0.7 added a new rows parameter to read_file. You can use it to read the first n rows, or a specific slice of rows.

import geopandas as gpd

# Read the first 100 rows
gdf = gpd.read_file("/path/to/my/shapefile.shp", rows=100)

# Read 5 rows from the 100000th
gdf = gpd.read_file("/path/to/my/shapefile.shp", rows=slice(100000, 100005))