Skip to content

Plotting ExtensionArrays #26173

Closed
Closed
@andrewgsavage

Description

@andrewgsavage

I'd like to plot data from an ExtensionArray. This currently results in an error TypeError: Empty 'DataFrame': no numeric data to plot

This is because the EA data is filtered out. Adding the ExtensionDtype to the filter criteria makes the plot work.
https://github.com/pandas-dev/pandas/blob/master/pandas/plotting/_core.py#L367

numeric_data = data.select_dtypes(include=[np.number,
                                               "datetime",
                                               "datetimetz",
                                               "timedelta", 
                                               pint.PintType])

Could we get a property of the ExtensionDtype that flags the dtype as holding plotable numeric data?

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