4

我正在尝试将.dbf文件转换为pandas.DataFrame. 但是,我从以下代码行中收到错误消息:

dbf = ps.open(dbf_link)

文件“/Users/UserName/anaconda/lib/python2.7/site-packages/pysal/core/IOHandlers/pyDbfIO.py”,第 77 行,在init assert terminator == '\r' AssertionError

这是我的代码:

import pysal as ps
import pandas as pd

dbf_link = '//Users/UserName/pyProjects/I_cst.Dbf'
dbf = ps.open(dbf_link)
d = {col: dbf.by_col(col) for col in dbf.header}
df = pd.DataFrame(d)
4

0 回答 0