-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Value become 0 while exporting (to_excel) the str data #39950
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
Comments
Hi @handy1988 Could you please put a descriptive title, and also show the output of |
Hi Marco, Sorry, I forgot to update the title, now edited already with output of csv. Thanks |
Hm when executing the following:
I get
Looks to me as the issue is in read_csv. Also your column is no text data, the e is interpreted as exponent, hence this is numeric |
You can do
to get your result |
HI phofl, Thanks for your reply, initially I thought this is a bug since I never faced this issue on previous version. I've tested it and it's working fine. Thanks again for your help👍 |
The conversion to 0 is in the same place as #38794, so closing in favor of that issue |
[X ] I have checked that this issue has not already been reported.
[X ] I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
Hi All,
I found some issue while exporting "str" data from some column to excel, And I noticed this issue occurred only after pandas version 1.1.5 and above. And attached my sample of data for your reference. Kindly help to check. Thanks
files.zip
output.csv
Col1,Col2
a1,50060e8007123400
a2,50060e8007123400
a3,50060e8007123400
a4,50060e8007123402
a5,50060e8007123402
a6,50060e8007123402
a7,50060e8007123402
a8,50060e8007123402
a9,50060e8007123404
a10,50060e8007123404
output.xlsx -> Current output
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 7d32926
python : 3.9.1.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_United States.1252
pandas : 1.2.2
numpy : 1.20.1
pytz : 2021.1
setuptools : 51.1.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.20.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : 3.0.6
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: