Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/v0.14.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Bug Fixes




- Bug in ``.ix`` getitem should always return a Series (:issue:`7150`)



Expand Down
7 changes: 3 additions & 4 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __getitem__(self, arg):
class IndexingError(Exception):
pass


class _NDFrameIndexer(object):
_valid_types = None
_exception = KeyError
Expand All @@ -61,7 +60,9 @@ def __iter__(self):
def __getitem__(self, key):
if type(key) is tuple:
try:
return self.obj.get_value(*key)
values = self.obj.get_value(*key)
if np.isscalar(values):
return values
except Exception:
pass

Expand Down Expand Up @@ -1101,8 +1102,6 @@ class _IXIndexer(_NDFrameIndexer):
""" A primarily location based indexer, with integer fallback """

def _has_valid_type(self, key, axis):
ax = self.obj._get_axis(axis)

if isinstance(key, slice):
return True

Expand Down
8 changes: 7 additions & 1 deletion pandas/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3570,8 +3570,14 @@ def test_float_index_to_mixed(self):
'a': [10] * 10}),
df)

def test_duplicate_ix_returns_series(self):
df = DataFrame(np.random.randn(3, 3), index=[0.1, 0.2, 0.2],
columns=list('abc'))
r = df.ix[0.2, 'a']
e = df.loc[0.2, 'a']
tm.assert_series_equal(r, e)


if __name__ == '__main__':
import nose
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)