Skip to content
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

TypeError: bad operand type for unary ~: 'float' #3

Open
PL450 opened this issue Aug 31, 2021 · 1 comment
Open

TypeError: bad operand type for unary ~: 'float' #3

PL450 opened this issue Aug 31, 2021 · 1 comment

Comments

@PL450
Copy link

PL450 commented Aug 31, 2021

Hi,
For pdf pages with similar layout to the Sample_FS.pdf, I get the above error. I think the code should work fine for similar layouts. So what is the issue? Can I solve the issue by some simple tweaking of the code?

Thank you


  File "C:/Users/Asus/anaconda3/Lib/SLICEmyPDF-main/slicemypdf\slicemypdf.py", line 712, in _get_token_coordinates
    ~coordinate_table.word_text.str.match(r"^(\s+|)\$(\s+|)$")

  File "C:\Users\Asus\anaconda3\lib\site-packages\pandas\core\generic.py", line 1436, in __invert__
    new_data = self._mgr.apply(operator.invert)

  File "C:\Users\Asus\anaconda3\lib\site-packages\pandas\core\internals\managers.py", line 425, in apply
    applied = b.apply(f, **kwargs)

  File "C:\Users\Asus\anaconda3\lib\site-packages\pandas\core\internals\blocks.py", line 378, in apply
    result = func(self.values, **kwargs)

TypeError: bad operand type for unary ~: 'float'
@PL450
Copy link
Author

PL450 commented Sep 1, 2021

Hi

The above error occurred even when the page has only 1 table and the headers of the table are in year. There is a title above the table, similar to the Sample_FS.pdf.

The page is pg 92 in the attached pdf dbs_2020.pdf.
dbs_2020.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant