Skip to content

DOC trying to improve readability of example #51634

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

Merged
merged 2 commits into from
Feb 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,14 @@ class CSSWarning(UserWarning):
Examples
--------
>>> df = pd.DataFrame({'A': [1, 1, 1]})
>>> (df.style.applymap(lambda x: 'background-color: blueGreenRed;')
... .to_excel('styled.xlsx')) # doctest: +SKIP
>>> df.style.applymap(
... lambda x: 'background-color: blueGreenRed;'
... ).to_excel('styled.xlsx') # doctest: +SKIP
... # CSSWarning: Unhandled color format: 'blueGreenRed'
>>> (df.style.applymap(lambda x: 'border: 1px solid red red;')
... .to_excel('styled.xlsx')) # doctest: +SKIP
... # CSSWarning: Too many tokens provided to "border" (expected 1-3)
>>> df.style.applymap(
... lambda x: 'border: 1px solid red red;'
... ).to_excel('styled.xlsx') # doctest: +SKIP
CSSWarning: Unhandled color format: 'blueGreenRed'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to remove ... # in this line?

Otherwise lgtm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved them back as technically they're part of the output, rather than the doctest

"""


Expand Down