-
-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: max() arg is an empty sequence #29
Comments
@SebastianDeLaile That looks like the problem with 3rd page, may be because the page is image but not text |
Yep the 3rd page looks like an image. |
I had this exception also when there are no tables recognized |
I have the same problem when there is only header and no data under it or when the tables are not recognized. Can someone tell us how to fix this. Thanks. |
As a temporary fix, I added try exception blocks to skip the table when something occurs like this. |
I also faced this issue. I think I'm also going to work with a temporary fix using try-except block. |
When running on this document (https://www.qao.qld.gov.au/sites/qao/files/annual-reports/annual_report_2016-17.pdf), when it reaches page 4, it throws the following ValueError:
import camelot
camelot.read_pdf(path, pages='3', flavor='stream')
Traceback (most recent call last):
File "", line 2, in
File "C:\Users\sdelail\AppData\Local\Continuum\anaconda3\envs\Financial_Extraction\lib\site-packages\camelot\io.py", line 117, in read_pdf
**kwargs
File "C:\Users\sdelail\AppData\Local\Continuum\anaconda3\envs\Financial_Extraction\lib\site-packages\camelot\handlers.py", line 172, in parse
p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
File "C:\Users\sdelail\AppData\Local\Continuum\anaconda3\envs\Financial_Extraction\lib\site-packages\camelot\parsers\stream.py", line 458, in extract_tables
cols, rows = self._generate_columns_and_rows(table_idx, tk)
File "C:\Users\sdelail\AppData\Local\Continuum\anaconda3\envs\Financial_Extraction\lib\site-packages\camelot\parsers\stream.py", line 349, in _generate_columns_and_rows
ncols = max(set(elements), key=elements.count)
ValueError: max() arg is an empty sequence
Easy enough to capture with a try/except but thought I would pop it up here to let you know
Thanks for writing this package, excellent work!
The text was updated successfully, but these errors were encountered: