sfcta / validation_workbook

Apache License 2.0
0 stars 4 forks source link

consider switching from pyshp to geopandas #17

Open chunhochow opened 2 months ago

chunhochow commented 2 months ago

For example, in the read_dbf_and_groupby_sum() function, we're just creating a dataframe out of the shapefile anyways, so why not just use geopandas directly

sf = shapefile.Reader(dbf_file_path)

# Extract fields and records from the DBF file
fields = [x[0] for x in sf.fields][1:]
records = sf.records()

# Create a DataFrame using the extracted data
df = pd.DataFrame(columns=fields, data=records)
sdrewc commented 2 months ago

I agree.