Pandas: convert dbf table to data frame

I want to read an dbfArcGIS form file file and upload it to a pandasdataframe. I am currently using the dbf package .

Apparently, I was able to download the file dbfin the form of a table, but could not figure out how to parse it and turn it into a pandas dataframe. What is the way to do this?

This is where I get stuck:

import dbf
thisTable = dbf.Table('C:\\Users\\myfolder\\project\\myfile.dbf')
thisTable.open(mode='read-only')

Python returns this statement as output, which I frankly don't know what to do:

dbf.ver_2.Table('C:\\Users\\myfolder\\project\\myfile.dbf', status='read-only')


EDIT

An example of my original dbf:

FID   Shape    E              N
0     Point    90089.518711   -201738.245555
1     Point    93961.324059   -200676.766517
2     Point    97836.321204   -199614.270439
...   ...      ...            ...
+4
source share
2 answers

You should look at simpledbf :

In [2]: import pandas as pd

In [3]: from simpledbf import Dbf5

In [4]: dbf = Dbf5('test.dbf')

In [5]: df = dbf.to_dataframe()

.dbf . , .

+6

Source: https://habr.com/ru/post/1668023/


All Articles