-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Make ExcelFormatter.header_style a class attribute instead of a property #50336
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
Thanks for the request; can you shorten the code posted? I'm guessing you do not need the entire code of the class. |
Hello. Thx for the quick reply. It's done. Let me know if I shorthened too much. |
Would it suffice to make a setter for the property instead? The advantage of a property is we could theoretically control the assignment and raise if for example particular expectations are not met as to what the header_style needs to provide |
Hello, |
In either case, is there a risk of errors due to the changing of this property while an ExcelWriter is open? I think the answer is no, but we should be certain before entertaining the idea. |
The above is the default. Using df.style \
.applymap_index(lambda v: "color:red; text-align:center;", axis=0) \
.applymap_index(lambda v: "color:blue;", axis=1) \
.to_excel("df_styler.xlsx") There is a bug that was fixed for v1.5.0 that corrected adding borders as well. Personally, I would prefer |
take |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
When I'm trying to remove the default ExcelFormatter header style, my IDE complains that the property cannot be set.

Pycharm suggest adding a setter but I don't think it's the correct behaviour.
This is very minor improvement as code runs perfectly well.
Feature Description
Change the ExcelFormatter header_style to be a class attribute instead of a property:
Alternative Solutions
Pycharm setter suggestion (which i find less relevant):
Additional Context
Just thanks for your hard work. 🐼
The text was updated successfully, but these errors were encountered: