Skip to content

pandas.io.formats.style.Styler.map is missing #1226

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

Open
Molkree opened this issue May 20, 2025 · 1 comment · May be fixed by #1228
Open

pandas.io.formats.style.Styler.map is missing #1226

Molkree opened this issue May 20, 2025 · 1 comment · May be fixed by #1228
Labels
good first issue Styler conditional formatting using DataFrame.style

Comments

@Molkree
Copy link

Molkree commented May 20, 2025

Describe the bug
pandas.io.formats.style.Styler.map method is missing from the stub

To Reproduce

import pandas as pd

df = pd.DataFrame(data={"col1": [1, -2], "col2": [-3, 4]})
df.style.map(lambda v: "color: red;" if v < 0 else None)

Last line raises type checker errors. mypy: error: "Styler" has no attribute "map" [attr-defined], pylance: Cannot access attribute "map" for class "Styler"

Please complete the following information:

  • OS: WSL
  • OS Version [e.g. 22]: Ubuntu 2024
  • python version: 3.13
  • version of type checker: mypy 1.15.0/pylance 2025.5.1 with pyright 1.1.400
  • version of installed pandas-stubs: 2.2.3.250308 but the issue is present on the latest 93a9e11
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented May 20, 2025

Thanks for the report. PR with tests welcome.

@Dr-Irv Dr-Irv added good first issue Styler conditional formatting using DataFrame.style labels May 20, 2025
@loicdiridollou loicdiridollou linked a pull request May 21, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants