Skip to content

Pandas DataFrame to Word Table takes a lot of time. #703

Open
@PulakKar

Description

@PulakKar

When I am trying to write a pandas dataframe to Ms Word it takes a long time.
I have 1000 rows in df.
It takes on an avg 50-60 mins to create the table.
My code is similar to this below:

`t = doc.add_table(df.shape[0]+1, df.shape[1])

for j in range(df.shape[-1]):
t.cell(0,j).text = df.columns[j]

for i in range(df.shape[0]):
for j in range(df.shape[-1]):
t.cell(i+1,j).text = str(df.values[i,j]) `
@scanny

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions