I am reading pdf using tabula-py.
from tabula import read_pdf
pdf_path = "/home/user/test.pdf"
df = read_pdf(pdf_path, pages='all', silent='True')
Unfortunately, my pdf formatting is not consistent and the text of one of the colum is split across multiple lines as shown below:
Date Comment post_id
----------------------------------
03/07/20 Comment 1 1
03/07/20 Comment b 1 2
NaN Comment b 2 NaN
NaN Comment b 3 NaN
04/07/20 Comment c 1 3
NaN Comment c 1 NaN
How can I format data frame to like below
Date Comment post_id
-------------------------------------------------------------
03/07/20 Comment 1 1
03/07/20 Comment b 1 Comment b 2 Comment b 3 2
04/07/20 Comment c 1 Comment c 1 3
few more single lines columns which are working as expected.