I'm using a pdf extraction tool to extract text from a pdf, which gives me a list of lists.
I can call each pdf page which is one of the lists within the list.
My list is called pdf_text, and I call each list by specifying either, [0], [1], or [2]
I have put each list into an array.
pdfArray = pdf_text[0]
pdfArray2 = pdf_text[1]
pdfArray3 = pdf_text[2]
I want to create a for loop which first checks to see if there are any more lists at the moment I only have 3, and then it assigns one of the arrays to a temp dataframe, and then it does the same for the second array and concatenates them into one main dataframe before doing the same for the final array. This would mean it would be able to check to see if there are any more arrays before creating the final dataframe with all 3 arrays.
I tried to incorporate the below function but it did not work, can anyone help?
combined_df = empty_df
for i in range(len(pdfArray[i]):
temp_df = pdfArray
combined_df.concat(temp_df)
Many thanks! :)