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

BUG: Indexing with duplicate columns #4726

Closed
jtratner opened this issue Sep 1, 2013 · 2 comments · Fixed by #4729

Comments

@jtratner
Copy link
Contributor

commented Sep 1, 2013

Currently failing test case:

df = DataFrame([[1,2,'foo','bar']], columns=['a','a','a','a'])
s = Series([1, 2, 'foo', 'bar'], index=['a', 'a', 'a', 'a'], name=0)
assert_series_equal(df.irow(0), s)

Here's what's going on right now.

In [3]: from pandas import *
In [4]: df = DataFrame([[1,2,'foo','bar']], columns=['a','a','a','a'])
In [5]: df
Out[5]:
   a  a    a    a
0  1  2  foo  bar

In [6]: df.irow(0)
Out[6]:
a    bar
a    bar
a    bar
a    bar
Name: 0, dtype: object

In [7]: df.icol(0)
Out[7]:
0    1
Name: a, dtype: int64

In [8]: df.columns
Out[8]: Index([u'a', u'a', u'a', u'a'], dtype=object)
@hayd

This comment has been minimized.

Copy link
Contributor

commented Sep 1, 2013

Also same with iloc:

In [9]: df.iloc[0, :]
Out[9]:
a    bar
a    bar
a    bar
a    bar
Name: 0, dtype: object

cc @jreback

@jreback

This comment has been minimized.

Copy link
Contributor

commented Sep 1, 2013

yep...this hits an older path that was never fixed for the _ref_locs.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.