You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Series.irow(i) (and also Series.iget(i)), with i being an integer, returns more than one value on Series with non-unique indexes if the index at location i has duplicates. This is not the behavior I expected and it is also different from the behavior shown by DataFrame.irow(i), since it only returns the row located at position i regardless of any existing index duplicates. Also the documentation for Series.irow/Series.iget specifies that an "int" parameter should return a "scalar" value, so I guess this might be a bug.
Here is some sample code I've run using pandas '0.8.2.dev-f5a74d4':
In [52]: s = Series([0, 1, 2], index=[0, 1, 0])
In [53]: s.irow(0) # here I was expecting 0
Out[53]:
0 0
0 2
In [54]: s.irow(1)
Out[54]: 1
In [55]: s.irow(2) # here I was expecting 2
Out[55]:
0 0
0 2
and its DataFrame counterpart:
In [56]: df = DataFrame([[0], [1], [2]], index=[0, 1, 0])
In [57]: df.irow(0)
Out[57]:
0 0
Name: 0
In [58]: df.irow(1)
Out[58]:
0 1
Name: 1
In [59]: df.irow(2)
Out[59]:
0 2
Name: 0
Thanks and regards.
The text was updated successfully, but these errors were encountered:
Hi,
Series.irow(i)
(and alsoSeries.iget(i)
), withi
being an integer, returns more than one value on Series with non-unique indexes if the index at locationi
has duplicates. This is not the behavior I expected and it is also different from the behavior shown byDataFrame.irow(i)
, since it only returns the row located at positioni
regardless of any existing index duplicates. Also the documentation forSeries.irow
/Series.iget
specifies that an "int" parameter should return a "scalar" value, so I guess this might be a bug.Here is some sample code I've run using pandas '0.8.2.dev-f5a74d4':
and its DataFrame counterpart:
Thanks and regards.
The text was updated successfully, but these errors were encountered: