使用Python从PDF中读取特殊字符和字体

时间:2018-05-22 10:45:55

标签: python-2.7 tabula

我有一个PDF,其中某些表行包含特殊字符和字体 for e.g.。有没有办法正确阅读这些。

from tabula import read_pdf

df = read_pdf("Tables PDF.pdf", pages = '5', lattice = True, multiple_tables = True, encoding = 'utf-8-sig')

我尝试了几种类型的编码utf-8asciiutf-8-sigISO-8859-1。如果还有其他方法,请告诉我。

还尝试单独读取其中一个值并进行更改,方法是使用:

df1.iloc[3, 6] = df1.iloc[3, 6].encode("utf-8", "replace")

没有成功。任何帮助将不胜感激。

0 个答案:

没有答案
相关问题