Skip to content

BUG: boxplot does not work when there is a datetime64 column #22799

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

Making a boxplot of a DataFrame does not seem to skip datetime64 columns, as you get the following error (it tries to calculate the mean of the datetime64 values):

In [4]: df = pd.DataFrame({'a': pd.date_range("2012-01-01", periods=100), 'b': np.random.randn(100), 'c': np.random.randn(100)+2})

In [6]: df.plot(kind='box')
...
TypeError: unsupported operand type(s) for +: 'Timestamp' and 'Timestamp'

While when this would be a string column, it would be correctly skipped.

This seems to be a regression, as at least in pandas 0.20.3 this worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionFunctionality that used to work in a prior pandas versionVisualizationplotting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions