0

I have a file (screen) in DBF format. I want to write it to the data frame. I found a post: https://stackoverflow.com/questions/41898561/pandas-transform-a-dbf-table-into-a-dataframe

And I do what I want with geopandas. But the problem is, that geopandas it's a problematic library. I transfer my code to friend, and he can't run script coz dependencies were broken (I have read that's a common problem with geopandas). So I tried to use another method from the post:

from simpledbf import Dbf5
dbf = Dbf5('K01.dbf')

But in this case, I got a coding error: 'utf-8' codec can't decode byte 0xae in position 10: invalid start byte. It's possible to handle it?

File: screenshot 1

File opened in excel:screenshot 2

I need to read it and put in pandas data frame. Can anyone help with it?

Joël Brigate
  • 237
  • 2
  • 13
martin
  • 1,145
  • 1
  • 7
  • 24
  • Look here: https://gist.github.com/celisflen-bers/fe827aa724997b0487a084d225054e2c and try to convert the dbf to csv. If it works - you can use panadas read_csv – balderman May 28 '19 at 11:02
  • `File "", line 2, in from dbfpy import dbf File "C:\...\dbf.py", line 280 print repr(_rec)` So something is wrong in python3 :( – martin May 28 '19 at 11:35
  • Do you have one dbf file only or multiple files? If it is one (or few files only), you can following https://smallbusiness.chron.com/convert-dbf-xls-55554.html and after that use pandas. – balderman May 28 '19 at 12:01

0 Answers0