-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Styler class doesn't apply formatting from Styler.format when writing to Excel #21221
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
Is this issue still alive? |
Still open. |
This can be worked around using #22015. You can use the |
The specific format strings needed for excel and the comparison to pythons much more generalist formatting language are not compatible. The Still not perfect though. Outstanding issues like
|
closing this as recorded in master tracker #42276 |
Code Sample, a copy-pastable example if possible
or to prevent actually writing to disk:
When reading the file the gradient will be applied correctly but the percentage formatting will not be.
Problem description
When the
Styler.to_excel
is called it doesn't write styles added using theStyler.format
method. The desired behaviour should be that all styling and formatting associated with theStyler
object should be written to the excel file just as it gets rendered in HTML.The excel writer being used is
openpyxl: 2.5.3
Expected Output
Excel document with formatting operations included.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.13.final.0
python-bits: 64
OS: Darwin
OS-release: 17.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
pandas: 0.23.0
pytest: None
pip: 9.0.3
setuptools: 39.0.1
Cython: None
numpy: 1.14.3
scipy: None
pyarrow: None
xarray: None
IPython: 5.7.0
sphinx: 1.7.4
patsy: None
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: 2.5.3
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: