You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I am using python-docx 0.8.11 and Python 3.8. I want to get ALL tables contained in a relatively large word docx file. I am using this code:
dfs = []
for table in document.tables:
df = [['' for i in range(len(table.columns))] for j in range(len(table.rows))]
for i, row in enumerate(table.rows):
for j, cell in enumerate(row.cells):
if cell.text:
df[i][j] = cell.text.replace('\n', '')
dfs.append(pd.DataFrame(df))
However it seems that a lot of tables are not extracted.
Do you have any idea why that might be?
Thank you very much!