Skip to content
This repository

.ix indexing can't handle duplicate index values #1201

Closed
wesm opened this Issue May 07, 2012 · 5 comments

3 participants

Wes McKinney Jason Knight sthornington
Wes McKinney
Owner
wesm commented May 07, 2012
(Pdb) result
      A   B   C   D
foo   2   3   4   5
bar   7   8   9  10
baz  12  13  14  15
qux  12  13  14  15
foo  12  13  14  15
bar  12  13  14  15
(Pdb) result.ix['bar']
*** Exception: Reindexing only valid with uniquely valued Index objects
Wes McKinney wesm closed this in e5490ef May 07, 2012
Jason Knight

I am still encountering this issue under 0.8.0, but now when trying to index with a list: (using the running example)

result.ix[['qux']]
Exception: Reindexing only valid with uniquely valued Index objects
Wes McKinney wesm reopened this July 03, 2012
Wes McKinney wesm closed this in 4406d37 July 12, 2012
sthornington

Not sure if this is the same, but I am getting this error in 0.8 vs 0.8b2 (I believe), when doing:

new_data = Panel(new_data).swapaxes(0, 2)

where new_data was just read using a DataReader.

Call stack:

Traceback (most recent call last):
File "load_data.py", line 34, in
new_data = Panel(new_data).swapaxes(0, 2)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/panel.py", line 219, in init
mgr = self._init_dict(data, passed_axes, dtype=dtype)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/panel.py", line 271, in _init_dict
v = v.reindex(index=major, columns=minor, copy=False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/frame.py", line 2122, in reindex
fill_value, limit)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/frame.py", line 2198, in _reindex_index
limit=limit)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/index.py", line 791, in reindex
limit=limit)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas-0.8.0-py2.7-macosx-10.6-intel.egg/pandas/core/index.py", line 712, in get_indexer
raise Exception('Reindexing only valid with uniquely valued Index '
Exception: Reindexing only valid with uniquely valued Index objects

Wes McKinney
Owner
wesm commented August 07, 2012

Can you test vs. 0.8.1?

sthornington

I cannot reproduce it with 0.8.1.

Wes McKinney
Owner
wesm commented August 15, 2012

Okay. I'm fairly certain you hit a bug in which Yahoo! finance started returning duplicate dates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.