Skip to content

ValueError on groupby boxplot #6263

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
fonnesbeck opened this issue Feb 5, 2014 · 5 comments
Closed

ValueError on groupby boxplot #6263

fonnesbeck opened this issue Feb 5, 2014 · 5 comments
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Visualization plotting

Comments

@fonnesbeck
Copy link

I have a pretty simple data frame of two columns, containing dates and velocities

    velocity    date
0    83.9    2007-08-04
1    89.6    2007-08-04
2    88.2    2007-08-04
3    88.9    2007-08-04
4    89.4    2007-08-04

Yet, when I try to make a box plot of velocities grouped by date, I get a ValueError:

pitches.boxplot(column='velocity', by='date')

ValueError: Wrong number of items passed 109, indices imply 108 

I've confirmed that velocity are floats and date are np.datetime64.

@cpcloud
Copy link
Member

cpcloud commented Feb 5, 2014

Tried to repro this with

In [1]: df = DataFrame({'velocity': normal(88, 0.5, size=10), 
                        'date': [pd.Timestamp('20070804')] * 5 + [pd.Timestamp('2008-08-09')] * 5})

In [2]: df
Out[2]:
        date   velocity
0 2007-08-04  87.622146
1 2007-08-04  87.817566
2 2007-08-04  87.878030
3 2007-08-04  87.823837
4 2007-08-04  88.603917
5 2008-08-09  88.038840
6 2008-08-09  88.591845
7 2008-08-09  87.881469
8 2008-08-09  87.510463
9 2008-08-09  87.527890

[10 rows x 2 columns]

but that works. Can you post ci/print_versions.py?

@fonnesbeck
Copy link
Author

Here is print_versions output:

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.5.final.0
python-bits: 64
OS: Darwin
OS-release: 13.0.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.13.0-395-gef55e60
Cython: 0.19.2
numpy: 1.9.0.dev-78e29a3
scipy: 0.14.0.dev-40896a5
statsmodels: 0.6.0.dev-a0fc6d1
IPython: 2.0.0-dev
sphinx: 1.1.3
patsy: None
scikits.timeseries: None
dateutil: 2.2
pytz: 2012d
bottleneck: None
tables: None
numexpr: 2.1
matplotlib: 1.4.x
openpyxl: 1.6.1
xlrd: 0.9.2
xlwt: None
xlsxwriter: None
sqlalchemy: 0.8.2
lxml: None
bs4: None
html5lib: None
bq: None
apiclient: None

FWIW, the boxplot worked using Seaborn:

seaborn

@cpcloud
Copy link
Member

cpcloud commented Feb 5, 2014

Okay I'll try out an Env with those versions and see if I can reproduce.

@jreback
Copy link
Contributor

jreback commented Feb 5, 2014

maybe a matplotlib 1.4 change?

@jreback
Copy link
Contributor

jreback commented Mar 22, 2014

this was fixed by #6659

@jreback jreback closed this as completed Mar 22, 2014
@jreback jreback added Bug and removed API Design labels Mar 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Visualization plotting
Projects
None yet
Development

No branches or pull requests

3 participants