Skip to content

BUG: df.to_excel() makes some default formatting #50991

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3 tasks done
Franky1 opened this issue Jan 26, 2023 · 2 comments
Closed
3 tasks done

BUG: df.to_excel() makes some default formatting #50991

Franky1 opened this issue Jan 26, 2023 · 2 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@Franky1
Copy link

Franky1 commented Jan 26, 2023

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
data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
df = pd.DataFrame.from_dict(data)
df.to_excel('bug.xlsx', index=True)

# have a look at the generated bug.xlsx file

Issue Description

Not really a bug, but a bit unexpected:
The index column and the header row is formatted in bold and with thin frame lines around.
The rest of the table data is not formatted.

Expected Behavior

I would expect no formatting at all, unless specified.
But maybe this behaviour is intended?

Installed Versions

INSTALLED VERSIONS

commit : 2e218d1
python : 3.9.10.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19045
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : de_DE.UTF-8
LOCALE : de_DE.cp1252

pandas : 1.5.3
numpy : 1.24.1
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 64.0.2
pip : 22.3.1
Cython : None
pytest : None
hypothesis : None
...
xlrd : None
xlwt : None
zstandard : None
tzdata : 2022.7

@Franky1 Franky1 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 26, 2023
@attack68
Copy link
Contributor

#50336 (comment)

@phofl
Copy link
Member

phofl commented Feb 6, 2023

Hi, thanks for your report. lets close this for the other issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

3 participants