Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorisvandenbossche opened this issue Sep 21, 2018 · 0 comments · Fixed by #27846
Closed

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

jorisvandenbossche opened this issue Sep 21, 2018 · 0 comments · Fixed by #27846
Labels
Regression Functionality that used to work in a prior pandas version Visualization plotting

Comments

@jorisvandenbossche
Copy link
Member

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.

@jorisvandenbossche jorisvandenbossche added Visualization plotting Regression Functionality that used to work in a prior pandas version labels Sep 21, 2018
@jorisvandenbossche jorisvandenbossche added this to the 0.23.5 milestone Sep 21, 2018
@jreback jreback modified the milestones: 0.23.5, 0.24.0 Oct 4, 2018
@jreback jreback modified the milestones: 0.24.0, Contributions Welcome Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Visualization plotting
Projects
None yet
2 participants