You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result and Excel warning : number formatted as string
Expected Output
(settings : German locale, decimal sign is ',')
0
0 2,445
Problem description
Since Decimal represents a numeric type, one would expect that it gets treated as such, just like floats.
The exported value in the Excel cell should be a number, not a string.
Presumably, the openpyxl Cell type should get set to 'n'.
Seemingly, openpyxl is able to handle decimals and knows a numeric Cell type 'n' but pandas deliberately sets string/non-numeric type as the openpyxl Cell type when a Decimal value is set.
Output of pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Windows
OS-release: 2012ServerR2
machine: AMD64
processor: Intel64 Family 6 Model 79 Stepping 0, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
Code Sample
(float output is prepared for the sake of comparison to Decimal)
Observed Output
(settings : German locale, decimal sign is ',')
result and Excel warning : number formatted as string
Expected Output
(settings : German locale, decimal sign is ',')
Problem description
Since Decimal represents a numeric type, one would expect that it gets treated as such, just like floats.
The exported value in the Excel cell should be a number, not a string.
Presumably, the openpyxl Cell type should get set to 'n'.
Seemingly, openpyxl is able to handle decimals and knows a numeric Cell type 'n' but pandas deliberately sets string/non-numeric type as the openpyxl Cell type when a Decimal value is set.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Windows
OS-release: 2012ServerR2
machine: AMD64
processor: Intel64 Family 6 Model 79 Stepping 0, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.24.2
pytest: None
pip: 10.0.1
setuptools: 39.1.0
Cython: None
numpy: 1.16.2
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: 2.6.2
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
None
The text was updated successfully, but these errors were encountered: