Skip to content

API: Add Styler.where #16255

Closed
Closed
@TomAugspurger

Description

@TomAugspurger

Code Sample, a copy-pastable example if possible

# Instead of 
df.style.applymap(lambda val: 'color: %s' % 'red' if val < 0 else 'black')

It would be

df.style.where(lambda val: val < 0, 'color: red', 'color: black')

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HTMLread_html, to_html, Styler.apply, Styler.applymap

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions