Skip to content

index and items switched in series error message #6532

Closed
@clarkfitzg

Description

@clarkfitzg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandas

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions