Skip to content
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

index and items switched in series error message #6532

Closed
clarkfitzg opened this issue Mar 3, 2014 · 3 comments
Closed

index and items switched in series error message #6532

clarkfitzg opened this issue Mar 3, 2014 · 3 comments
Labels
Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@clarkfitzg
Copy link
Contributor

Running this code:

pd.Series([1, 2], index=[1, 2, 3, 4, 5])

Raises this value error:

ValueError: Wrong number of items passed 5, indices imply 2

I expected to see this:

ValueError: Wrong number of items passed 2, index implies 5

Comparing my traceback with the current code it looks like an easy fix- just switch the order of the tuple in line 65 of core/internals.py

Using Anaconda distribution:

In [6]: show_versions()

INSTALLED VERSIONS
------------------
Python: 2.7.6.final.0
OS: Darwin
Release: 13.1.0
Processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.13.0
Cython: 0.20
Numpy: 1.8.0
Scipy: 0.13.3
statsmodels: 0.5.0
    patsy: 0.2.1
scikits.timeseries: Not installed
dateutil: 1.5
pytz: 2013b
bottleneck: Not installed
PyTables: 3.1.0
    numexpr: 2.3
matplotlib: 1.3.1
//anaconda/lib/python2.7/site-packages/openpyxl/__init__.py:31: UserWarning: The installed version of lxml is too old to be used with openpyxl
  warnings.warn("The installed version of lxml is too old to be used with openpyxl")
openpyxl: 1.8.2
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: Not installed
sqlalchemy: 0.9.2
lxml: 3.2.3
bs4: 4.3.1
html5lib: Not installed
bigquery: Not installed
apiclient: Not installed
@jreback
Copy link
Contributor

jreback commented Mar 3, 2014

@clarkfitzg sure....pls do a PR, note that some tests should fail if you make this change (so you have to reverse check in the test too), they are checking the text of the error message

@hayd
Copy link
Contributor

hayd commented Mar 4, 2014

@jreback hmmm tests passed even without changing the text.

@jreback
Copy link
Contributor

jreback commented Mar 4, 2014

tests are only on frames so this is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

No branches or pull requests

3 participants