【发布时间】:2022-11-25 19:39:34
【问题描述】:
我试图将包含数据表的 PDF 文件转换为 excel 文件。 这是我的绳索。
import tabula
# Read PDF File
df = tabula.read_pdf("files/Seniority List 2018 19.pdf", pages = 1)
# Convert into Excel File
df.to_excel('files/excel.xlsx')
但发生错误。
AttributeError Traceback (most recent call last)
Input In [5], in <cell line: 9>()
6 df = tabula.read_pdf("files/Seniority List 2018 19.pdf", pages = 1)
8 # # Convert into Excel File
----> 9 df.to_excel('files/excel.xlsx')
AttributeError: 'list' object has no attribute 'to_excel'
PDF来自这里 https://www.docdroid.net/jTWmB15/seniority-list-2018-19-pdf
我如何使用“to_excel”?
我刚刚在这个问题中提到了上述设置,但如果需要更多代码,请告诉我我会用这些信息更新我的问题。谢谢
【问题讨论】: