从Excel或PDF到Pandas的非正统数据

2024-03-28 21:06:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我在PDF中列出了机构的捐赠者;here's就是一个例子。我可以把它们转换成excel,在那里我会得到这样的东西:

enter image description here

不用说,当我只是做pd.read_excel(filename)的时候,结果并不有趣。你知道吗

有没有一个好的方法,Pythonic的方法把它们转换成这样的格式:

Name,Amount
The City of New York,2000000
The State of New York,2000000
United States Department of Transportation,2000000
Michael R. Bloomberg,2000000
...
Ronnie and Lawrence D. Ackman,1000000
American Express,1000000

Tags: ofthe方法newreadherepdf机构