首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tabula-py用于无边框表格提取

Tabula-py用于无边框表格提取
EN

Stack Overflow用户
提问于 2018-07-17 17:04:02
回答 3查看 1.8K关注 0票数 2

有没有人可以建议我如何使用python/java程序从PDF中提取表格数据,用于pdf文件中的以下无边框表格?

EN

回答 3

Stack Overflow用户

发布于 2018-08-08 15:18:12

对于tabla来说,这张桌子可能很难。使用guess=False, stream=True怎么样?

更新:从tabula-py 1.0.3开始,guessstream应该可以协同工作。无需将guess=False设置为使用streamlattice选项。

票数 2
EN

Stack Overflow用户

发布于 2021-07-06 18:54:20

我通过tabula-py解决了这个问题

代码语言:javascript
复制
conda install tabula-py

代码语言:javascript
复制
>>> import tabula
>>> area = [70, 30, 750, 570] # Seems to have to be done manually
>>> page2 = tabula.read_pdf("nar_2021_editorial-2.pdf", guess=False, lattice=False, 
                 stream=True, multiple_tables=False, area=area, pages="all",
                   ) # `tabula` doc explains params very well
>>> page2

我得到了这样的结果

代码语言:javascript
复制
> 'pages' argument isn't specified.Will extract only from page 1 by default. [      
> ShortTitle                                              Text  \  0    
> Arena3Dweb         3D visualisation of multilayered networks     1    
> Aviator       Monitoring the availability of web services     2       
> b2bTools  Predictions for protein biophysical features and     3      
> NaN                                their conservation     4         
> BENZ WS          Four-level Enzyme Commission (EC) number     ..      
> ...                                               ...     68 
> miRTargetLink2              miRNA target gene and target pathway    
> 69             NaN                                          networks  
> 70       mmCSM-PPI            Effects of multiple point mutations on  
> 71             NaN                      protein-protein interactions  
> 72        ModFOLD8           Quality estimates for 3D protein models  
> 
>  
>                                                 URL    0                    http://bib.fleming.gr/Arena3D    1         
> https://www.ccb.uni-saarland.de/aviator    2                   
> https://bio2byte.be/b2btools/    3                                    
> NaN    4                 https://benzdb.biocomp.unibo.it/    ..       
> ...    68  https://www.ccb.uni-saarland.de/mirtargetlink2    69       
> NaN    70          http://biosig.unimelb.edu.au/mmcsm ppi    71       
> NaN    72       https://www.reading.ac.uk/bioinf/ModFOLD/      [73
> rows x 3 columns]]

这是一个可迭代的obj,因此您可以通过for row in page2:操作它

希望能对你有所帮助

票数 0
EN

Stack Overflow用户

发布于 2021-11-27 10:37:22

Tabula-py无边框表解压缩:

Tabula-py有,它是基于gaping的真检测表。

代码语言:javascript
复制
from tabula convert_into
src_pdf = r"src_path"
des_csv = r"des_path"
convert_into(src_pdf, des_csv, guess=False, lattice=False, stream=True, pages="all")
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51377295

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档