rsaim / supplementary

Portal to analyze and visualize results of DTU students.
1 stars 0 forks source link

tabula ignores pdf pages having only one line of data #7

Open rsaim opened 4 years ago

rsaim commented 4 years ago

Reproducer:

In [12]: filepath="/Users/saim/github/supplementary/dtu_results/DIS_BT_656_657.pdf"

In [13]: pages_df = tabula.read_pdf(filepath, pages="all")

In [14]: len(pages_df)
Out[14]: 2

In [18]: print(pages_df)
[          Sr.No. Name  Unnamed: 0              Roll No. CE-301 CE-302 CE-303 CE-304 CE-305 CE-306 CE-307 CE-308 CE-309    TC    SPI       Unnamed: 1
0                 NaN         NaN  Max. Marks / Credits  100/4  100/4  100/4  100/4  100/4  100/2  100/2  100/2  200/4  30.0    NaN    Papers Failed
1    1 APURV ASHUTOSH         NaN            2K14/CE/23     78     79     87     67     80     90     81     81    173  30.0  80.47              NaN
2              SHARMA         NaN                   NaN    NaN    NaN    NaN    NaN    NaN    NaN    NaN    NaN    NaN   NaN    NaN              NaN
3  2 PRASHANT TEVATIA         NaN            2K14/CE/65     10     16     14      6      9     60     70     76    166  10.0  24.80  CE-305CE-304CE-,        Sr.No. Name  Unnamed: 0              Roll No. EL-301 EL-302 EL-303 EL-304 EL-305 EL-306 EL-307 EL-308 EL-309  TC  SPI     Unnamed: 1
0              NaN         NaN  Max. Marks / Credits  100/4  100/4  100/4  100/4  100/4  100/2  100/2  100/2  200/4  30  NaN  Papers Failed
1   1 ROSHAN GUPTA         NaN            2K14/EL/80     45    NaN    NaN    NaN     47    NaN    NaN    NaN    NaN   8  NaN            NaN
2  2 SAGAR KATARIA         NaN            2K14/EL/81     41    NaN     60    NaN    NaN    NaN    NaN    NaN    NaN   8  NaN            NaN
3     3 TUSHAR SAH         NaN            2K14/EL/99     45    NaN     48    NaN     27    NaN    NaN    NaN    NaN   8  NaN         EL-305]

The pdf actually has 5 pages. However, pages 1, 4 and 5 are ignored by tabula as these have only 1 line of data.

image