Skip to content

Pandas is not able to append dataframe to an existing excel sheet.Although openpyxl can be used for it but openpyxl is also destroying pivot table and all other realted information.So we do not have another way available except openpyxl #29990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vishavgupta97 opened this issue Dec 3, 2019 · 13 comments
Labels
IO Excel read_excel, to_excel Usage Question

Comments

@vishavgupta97
Copy link

Code Sample, a copy-pastable example if possible

# Your code here

Problem description

[this should explain why the current behaviour is a problem and why the expected output is a better solution.]

Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!

Note: Many problems can be resolved by simply upgrading pandas to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if master addresses this issue, but that is not necessary.

For documentation-related issues, you can check the latest versions of the docs on master here:

https://pandas-docs.github.io/pandas-docs-travis/

If the issue has not been resolved there, go ahead and file it in the issue tracker.

Expected Output

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

@gfyoung
Copy link
Member

gfyoung commented Dec 3, 2019

Lack of example notwithstanding, have a look at this link here:

https://stackoverflow.com/questions/47737220/append-dataframe-to-excel-with-pandas/47738103

If you could post example code, that would be great so that everyone can reference this.

@gfyoung gfyoung added IO Excel read_excel, to_excel Usage Question labels Dec 3, 2019
@vishavgupta97
Copy link
Author

vishavgupta97 commented Dec 3, 2019 via email

@vishavgupta97
Copy link
Author

By this way pivot table and all the related information is getting destroyed.So using openpyxl is not an efficient way to achieve it. How it can achieve by xlwings or win32com because by using helper function of openpyxl ,we are unable to achieve it

@gfyoung
Copy link
Member

gfyoung commented Dec 3, 2019

@vishavgupta97 : Please share example code. It is otherwise difficult to provide guidance.

@vishavgupta97 vishavgupta97 changed the title Pandas is not able to append dataframe to an existing excel sheet Pandas is not able to append dataframe to an existing excel sheet.Although openpyxl can be used for it but openpyxl is also destroying pivot table and all other realted information.So we do not have another way available except openpyxl Dec 3, 2019
@vishavgupta97
Copy link
Author

@vishavgupta97
Copy link
Author

vishavgupta97 commented Dec 3, 2019 via email

@vishavgupta97
Copy link
Author

Check here

@gfyoung
Copy link
Member

gfyoung commented Dec 3, 2019

@vishavgupta97 : Can you share the input data as well? We are looking for a complete example of code (and data) that we can run exactly that reproduces the issue you're describing.

@vishavgupta97
Copy link
Author

I am getting this warning message C:\Users\abcd\PycharmProjects\Abacus_Report\venv\lib\site-packages\openpyxl\worksheet_reader.py:292: UserWarning: Slicer List extension is not supported and will be removed
warn(msg)

@vishavgupta97
Copy link
Author

https://stackoverflow.com/questions/59134136/pivot-table-get-destroyed-while-appending-dataframe-below-excel-using-openpyxl

https://stackoverflow.com/questions/59151055/how-to-write-dataframe-below-an-existing-excel-sheet-without-losing-value-of-piv

Here are above two links for the description of problem. I am really sorry I can't share the data because it is very crucial data for our business organisation.However I will try to post an example of data

@vishavgupta97
Copy link
Author

Please help to find solution of this particular problem

@gfyoung
Copy link
Member

gfyoung commented Dec 3, 2019

Please try to post example data so that we can help you

@mroeschke
Copy link
Member

Happy to reopen when we get a reproducible example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Excel read_excel, to_excel Usage Question
Projects
None yet
Development

No branches or pull requests

3 participants