Skip to content

Improve error message with pandas output and sparse data #26515

@glemaitre

Description

@glemaitre

Currently, we raise an error:

ValueError: Pandas output does not support sparse data.

when a transformer does output sparse data and we try to wrap it inside a dataframe due to set_output(transform="pandas"). I assume that at this point, we could be extra nice and check if the transformer has a sparse_output keyword and advice changing it to False. We can also document that doing this change would be memory inefficient (it might blow up your RAM) but useful when it comes to data introspection.

What do you think about this proposal @thomasjpfan?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions