-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Data corruption during Excel export #10970
Comments
can you show the dataframe in question above ( |
df.info()
df.dtypes
df.head()
|
For information the value incorrectly exported to Excel is TEMP 11 (B14)_°C at time 11/08/2015 01:05:00. In the .csv file and as printed by ".head()" the value is 10.4107588318426. |
This might be the old excel-duplicate-column-name problem. The problem goes away if I rename the frame so that no columns are duplicated, and it looks like the errors come in after the first duplicate |
I've just tried to modify the name of the last column (the second Ref #11/ADIT_°C ) and indeed it solved the problem. |
In some case a DataFrame exported to excel present some bad values.
It's is not a problem of Excel reading (the data inside the sheet1.xml of the .xlsx file is also incorrect).
The same DataFrame exported to ".csv" is correct.
The problem could be "solved" by renaming the column header as [col-1, col-2,...]. Maybe an encoding problem ?
The issue is that there is no warning/error during the export. It's very easy to miss it.
To reproduce:
with the file available here: https://drive.google.com/file/d/0Bzz_ZaP_wS_HMFdlMkVzaTR0cjA/view?usp=sharing
Note that the content of cell M14 is different in both file (at least when run on my computer)
Using:
The text was updated successfully, but these errors were encountered: