camelot icon indicating copy to clipboard operation
camelot copied to clipboard

Last row of table missing from output

Open nikhil-R-A opened this issue 4 years ago • 4 comments

I've been using Camelot only recently, and am noticing that for all my pdf files Camelot's output does not have the last row of the table I'm searching for. It's very peculiar because it reads all the other rows in the table perfectly. I've tried scanning the issues page for any answers or things I can try, and have tried to use matplotlib to plot joints, lines etc but all of that is perfect. It looks like Camelot detects the table correctly, but for some reason is not able to produce the last row, and instead is producing a blank row after the header row of the table. Can anyone advise me on what I can do? This package is really efficient and I would love to use it, but this issue is the only thing that's preventing me from using it

nikhil-R-A avatar Jul 23 '21 16:07 nikhil-R-A

Please attach the PDF and the code you use.

anakin87 avatar Jul 27 '21 08:07 anakin87

Unfortunately I'm not sure whether I'm allowed to, but I did some debugging and figured out that the lattice is not assigning the data to the rows correctly. Specifically, it's assigning the data in a row to the row below it, due to which the data in the last row is not assigned to the lattice and the first row of the lattice is empty.

nikhil-R-A avatar Jul 27 '21 16:07 nikhil-R-A

Hey @nikhil-R-A I am facing a similar issue but I am at liberty to link my pdf so I am linking the pdf and code, so It will be helpful.

import camelot  
df_table = camelot.read_pdf(file_name, flavor = "lattice", pages='65')
print(df_table[0].df)

link to pdf : https://www.education.gov.in/sites/upload_files/mhrd/files/statistics-new/AISHE2016-17.pdf

The issue is that the data for the first row is being assigned to the second row and so on.

paul-tharun avatar Oct 04 '21 17:10 paul-tharun

This is the original file: image

This is the extracted dataframe: image

anakin87 avatar Oct 05 '21 06:10 anakin87