将 PDF 文件导出到 csv 时,它返回错误:writeheader() 采用 1 个位置参数但给出了 2 个
from tabula import read_pdf
from tabulate import tabulate
import csv
df = read_pdf("asd.pdf")
print(df)
with open('ddd.csv', "w", newline="") as file:
columns = ['specialty ',"name",'number_of_seats','Total_seats,' "document_type", "concent"]
writer = csv.DictWriter(file, fieldnames=columns)
writer.writeheader(df)