Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Data corruption during Excel export #10970
Comments
|
can you show the dataframe in question above ( |
jreback
added the
Excel
label
Sep 2, 2015
|
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. |
bertrandhaut commentedSep 2, 2015
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: