Skip to content

Table extraction #406

Answered by samkit-jain
erkin98 asked this question in Q&A
Apr 6, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Thanks for sharing the PDF. The tables are getting merged in because they are contiguous. One option could be to remove the None values from the rows and then separate them as 2 tables like

for row in merged_table:
    non_null_row = [cell for cell in row if cell is not None]
    
    if len(non_null_row) > 2:
        middle_table.append(non_null_row)
    else:
        bottom_table.append(non_null_row)

Does it solve your use case?

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@erkin98
Comment options

Comment options

You must be logged in to vote
1 reply
@erkin98
Comment options

Answer selected by samkit-jain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants