0
I have lists of different lengths with data extracted from a PDF.
Each value and code is part (is inside) of a respective note:
cliente = ['12345','15432']
nota = ['21/0576750-3', '20/063859-1']
codigo = [86, 6052,5031,1038,1025]
valor = [100.45, 200.34, 450.10, 150.58, 42.30]
I want to turn this data into a dataframe like this:
Note: The challenge is to be able to create relationships one for many in order to keep the correspondence between the data of the lines.
I tried the following code, but the table loses the reference of the line data.
tabela = list(zip(cliente,nota,codigo,valor)
df = pd.DataFrame(tabela, columns = ['Cliente', 'Nota', 'Código','Valor'])
df.to_excel('d:/nome.xlsx', index=False)
Could anyone help? Thank you!
Can put the sample pdf?
– lmonferrari
Imonferrari, man, I managed to solve with the solution I posted below. Thank you so much for your attention!
– Re_Moreira