Skip to content

BUG: Hide columns doesn't work #49985

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

Closed
3 tasks done
Hraesvelg opened this issue Dec 1, 2022 · 1 comment
Closed
3 tasks done

BUG: Hide columns doesn't work #49985

Hraesvelg opened this issue Dec 1, 2022 · 1 comment

Comments

@Hraesvelg
Copy link

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

df = pd.DataFrame(1, range(3), ['Look', 'At', 'My', 'Header'])
df.style.hide(axis='columns').to_excel("table.xlsx")

Issue Description

After the generation, the header always appears

i tried many functions in documentation (or stack) and they have no effect...

Expected Behavior

the first line should be hidden

Installed Versions

INSTALLED VERSIONS

commit : 8dab54d
python : 3.8.10.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-56-generic
Version : #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : fr_FR.UTF-8

pandas : 1.5.2
numpy : 1.23.5
pytz : 2022.6
dateutil : 2.8.2
setuptools : 60.2.0
pip : 21.3.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 : 3.1.2
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None

@Hraesvelg Hraesvelg added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 1, 2022
@attack68
Copy link
Contributor

attack68 commented Dec 1, 2022

Documentation of Styler.hide:

Screenshot 2022-12-01 at 20 35 37

I believe you have to use the DataFrame.to_excel arguments to hide column headers or indexes.

@attack68 attack68 added Usage Question and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 1, 2022
@attack68 attack68 closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants