【发布时间】:2021-11-27 15:31:56
【问题描述】:
我想知道如何在 python 中从 pdf 文件中提取特定的表列。
到目前为止我的代码
import tabula.io as tb
from tabula.io import read_pdf
dfs = tb.read_pdf(pdf_path, pages='all')
print (len(dfs)) [It displays 73]
我可以通过 print (dfs[2]['Section ID']) 访问单个表格列 我想知道如何使用 for 循环搜索所有数据框中的特定列。
我想做这样的事情
for i in range(len(dfs)):
if (dfs[i][2]) == 'Section ID ' //(This gives invalid syntax)
print dfs[i]
【问题讨论】:
标签: python pandas dataframe tabula-py