dbf

How to read dbf file in python and convert it to dataframe

How to read dbf file in python and convert it to dataframe Question: I am trying to read a dbf file using simpledbf library and convert to to dataframe for further processing. from simpledbf import Dbf5 dbf = Dbf5(r"C:UsersPrashant.kumarDownloadsdbfF1_1.DBF") df1 = dbf.to_dataframe() Unfortunately, I am getting the following error. I tried to find a solution …

Total answers: 1

Why is dbf-table still open, if using "with tbl.open()"?

Why is dbf-table still open, if using "with tbl.open()"? Question: I use Ethan Furmans dbf-python-module (v. 0.99.3). If I use this code: import dbf tbl = dbf.Table(os.path.join(db_pfad, tabelle + ".dbf")) with tbl.open(mode=dbf.READ_ONLY) as tbl: for rec in tbl: … tbl.close() … everything is running fine. But for my understanding of using with-clause, the last line …

Total answers: 1

Writing dbf file with custom encoding (DBF Package)

Writing dbf file with custom encoding (DBF Package) Question: I have some Characters in Farsi and I want to write them to a dbf file with my custom codepage which is 1 byte per character. I think this problem can be solved in one of these two ways: 1- Passing my custom codepage to the …

Total answers: 2

Problems opening DBF files in python

Problems opening DBF files in python Question: I am trying to open en transform several DBF files to a dataframe. Most of them worked fine, but for one of the files I receive the error: “UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf6 in position 15: invalid start byte” I have read this error on some …

Total answers: 4

Pandas: transform a dbf Table into a dataframe

Pandas: transform a dbf Table into a dataframe Question: 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 been able to load the dbf file as a Table, but have not been able to figure out …

Total answers: 8

Python dbfpy and FoxPro

Python dbfpy and FoxPro Question: I am using an ancient database format here, dbf files. Don’t ask why, just know a certain software decided to extend foxpro support because microsoft decided to extend foxpro support. Now, I’m getting the following error on a specific file. I have successfully loaded another file and I’m curious if …

Total answers: 4