Skip to content

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

@PL450

Description

@PL450

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions