Skip to content

ENH: Styler display of NaN / null Values #21527

Closed
@psychemedia

Description

@psychemedia

The Styler allows for null cells to be highlighted using .style.highlight_null() but a nan text string will also be displayed.

If a column is coloured using .background_gradient() it must be a numeric type otherwise numerical comparisons fail. This means that using a construction of the form ..fillna('') on the column will create an error as the column is cast to an object type.

nan values can be removed in the rendered table using a hack of the form .render().replace('nan','') but it would be cleaner to use something along the lines of .style.replace_null(value) that could be used to tidy up the display of nan cells.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HTMLread_html, to_html, Styler.apply, Styler.applymapOutput-Formatting__repr__ of pandas objects, to_stringVisualizationplotting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions