newbie to Python.
I'm trying to extract data from a dataframe and put it into a string to print to a docx file.
This is my current code:
add_run("Placeholder A").italic= True
for i in range(0, list(df.shape)[0]):
A = df.iloc[findings][0]
B = df.iloc[findings][1]
C =df.iloc[findings][2]
output = ('The value of A: {}, B: {}, C: {}').format(A,B,C)
doc.add_paragraph(output)
The output I am after is:
Placeholder A
- print output for row 1 of DF
Placeholder A
- print output for row 2 of DF
Currently it is printing all the outputs of the dataframe under Placeholder A.
Any ideas where I am going wrong?