I want to read a dbf
file of an ArcGIS shapefile and dump it into a pandas
dataframe. I am currently using the dbf package.
I have apparently b
How about using dbfpy? Here's an example that shows how to load a dbf with 3 columns into a dataframe:
from dbfpy import dbf
import pandas as pd
df = pd.DataFrame(columns=('tileno', 'grid_code', 'area'))
db = dbf.Dbf('test.dbf')
for rec in db:
data = []
for i in range(len(rec.fieldData)):
data.append(rec[i])
df.loc[len(df.index)] = data
db.close()
If necessary, you could find out the column names from db.fieldNames.