时间:2021-07-01 10:21:17 帮助过:5人阅读
然后直接代码:
import dbfread import pandas as pd file_name = "xscj (2).dbf" table = dbfread.DBF(file_name, encoding=‘GBK‘) data = {} for record in table: for field in record: if field not in data: data[field] = [record[field]] else: data[field].append(record[field]) df = pd.DataFrame(data) df.to_excel(file_name[:-4] + ".xlsx", index=False)
dbf转excel
标签:frame tab gbk data record pre col taf color