Skip to content

Plotly express not compatible with pandas NAType/pandas.NA/pd.NA values #3253

Closed
@devmcp

Description

@devmcp

Plotly express functions fall over when given dataframes containing pd.NA values. I think these should have the same behaviour as None values.

Example:

# This works
px.scatter(pd.DataFrame([1, 2, 3, None, 5]))

# This results in "TypeError: Object of type NAType is not JSON serializable"
px.scatter(pd.DataFrame([1, 2, 3, None, 5]).convert_dtypes())

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething brokensev-3annoyance with workaround

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions