question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

excel header_style broken in 0.22

See original GitHub issue
import pandas as pd
pd.io.formats.excel.header_style = None

After updating, it is no longer possible to override the excel header styles.

Previously, this was possible in 0.19.2:

pd.formats.format.header_style = None

It seems header_style has been moving around constantly lately… Can we please put it somewhere and leave it there??? Or, if it’s going to be moved constantly, it should live on a private module path. I realize python doesn’t have private scoping, but there are paths in the pandas module that are privately scoped, by convention, yet don’t follow the standard python convention of underscoring the names.

How are we supposed to accomplish the removal of styles on the latest build?

That module path DOES indeed exist… but something is wonky with the imports, it seems.

Exception is raised: AttributeError: 'module' object has no attribute 'excel'

Possibly related? https://github.com/pandas-dev/pandas/pull/15530

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Diegostasticocommented, May 31, 2021

From version 0.24 (Jan 25, 2019) this is now required:

import pandas.io.formats.excel pandas.io.formats.excel.ExcelFormatter.header_style = None

currently still working for pandas version 1.2.4 (Apr 12, 2021)

0reactions
WillAydcommented, Jun 10, 2019

There isn’t a currently exposed way of doing this. #25185 is open if you’d like to take a look and contribute something on that front

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headers and footers in a worksheet - Microsoft Support
On the Insert tab, in the Text group, click Header & Footer. Header & Footer option on the Insert tab. Excel displays the...
Read more >
Turn Excel table headers on or off - Microsoft Support
When you create an Excel table, a table Header Row is automatically added as the first row of the table, but you have...
Read more >
Set up your header row - Microsoft Support
To rename the columns, double-click each column header and type the name you want or edit an existing one. To return the transformed...
Read more >
Format text in headers or footers - Microsoft Support
Ensure that either a header or a footer (or both) have been added to the worksheet. Open the worksheet containing the header or...
Read more >
How to avoid broken formulas - Microsoft Support
You'll return to the cell with the broken formula, which will be in edit mode, and Excel will highlight the spot where it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found