I was wondering if someone could help - complete Newbie in Python and struggling. I have a Pandas, Dataframe which I have then exported to a table in word using Docx however I am struggling to set the font size to 7. and to draw the lines around the table can anyone help please?
My code to create the table from the data frame ive created is as follows:
t = doc.add_table(newdataframe.shape[0]+1, newdataframe.shape[1]) for j in range(newdataframe.shape[-1]):
t.cell(0,j).text = newdataframe.columns[j]
for i in range(newdataframe.shape[0]):
for j in range(newdataframe.shape[-1]):
t.cell(i+1,j).text = str(newdataframe.values[i,j])
Would be extremely grateful for anyones help :)