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

reindexing non-unique dataframes #2862

Closed
Aico opened this issue Feb 13, 2013 · 0 comments
Closed

reindexing non-unique dataframes #2862

Aico opened this issue Feb 13, 2013 · 0 comments

Comments

@Aico
Copy link

Aico commented Feb 13, 2013

df3 = DataFrame({'a':[1]})
df4 = DataFrame({'a':[1,2]})
df3
a
0 1
df4
a
0 1
1 2
df4.index = [1,1]
df4.reindex(df3.index)
Traceback (most recent call last):
File "", line 1, in
File "/hostname/home/chik/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 2347, in reindex
'column labels')
File "/hostname/home/chik/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 2423, in _reindex_index
clidx, cridx = None, None
File "/hostname/home/chik/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pandas/core/index.py", line 828, in reindex
return com._ensure_platform_int(indexer)
File "/hostname/home/chik/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pandas/core/index.py", line 749, in get_indexer
def set_value(self, arr, key, value):
Exception: Reindexing only valid with uniquely valued Index objects

Why is this not possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant