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
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-5-4865919a19c8> in <module>()
----> 1 s.loc[:4, 'a':'c'] # raises KeyError
/Users/shoyer/dev/pandas/pandas/core/indexing.pyc in __getitem__(self, key)
1125 def __getitem__(self, key):
1126 if type(key) is tuple:
-> 1127 return self._getitem_tuple(key)
1128 else:
1129 return self._getitem_axis(key, axis=0)
/Users/shoyer/dev/pandas/pandas/core/indexing.pyc in _getitem_tuple(self, tup)
643 def _getitem_tuple(self, tup):
644 try:
--> 645 return self._getitem_lowerdim(tup)
646 except IndexingError:
647 pass
/Users/shoyer/dev/pandas/pandas/core/indexing.pyc in _getitem_lowerdim(self, tup)
751 # we may have a nested tuples indexer here
752 if self._is_nested_tuple_indexer(tup):
--> 753 return self._getitem_nested_tuple(tup)
754
755 # we maybe be using a tuple to represent multiple dimensions here
/Users/shoyer/dev/pandas/pandas/core/indexing.pyc in _getitem_nested_tuple(self, tup)
810
811 # this is a series with a multi-index specified a tuple of selectors
--> 812 return self._getitem_axis(tup, axis=0, validate_iterable=True)
813
814 # handle the multi-axis by taking sections and reducing
/Users/shoyer/dev/pandas/pandas/core/indexing.pyc in _getitem_axis(self, key, axis, validate_iterable)
1267 # nested tuple slicing
1268 if _is_nested_tuple(key, labels):
-> 1269 locs = labels.get_locs(key)
1270 indexer = [ slice(None) ] * self.ndim
1271 indexer[axis] = locs
/Users/shoyer/dev/pandas/pandas/core/index.pyc in get_locs(self, tup)
3602 elif isinstance(k,slice):
3603 # a slice, include BOTH of the labels
-> 3604 ranges.append(self._get_level_indexer(k,level=i))
3605 else:
3606 # a single label
/Users/shoyer/dev/pandas/pandas/core/index.pyc in _get_level_indexer(self, key, level)
3527 # otherwise a boolean indexer
3528
-> 3529 start = level_index.get_loc(key.start)
3530 stop = level_index.get_loc(key.stop)
3531 step = key.step
/Users/shoyer/dev/pandas/pandas/core/index.pyc in get_loc(self, key)
1167 loc : int if unique index, possibly slice or mask if not
1168 """
-> 1169 return self._engine.get_loc(_values_from_object(key))
1170
1171 def get_value(self, series, key):
/Users/shoyer/dev/pandas/pandas/index.so in pandas.index.IndexEngine.get_loc (pandas/index.c:3651)()
/Users/shoyer/dev/pandas/pandas/index.so in pandas.index.IndexEngine.get_loc (pandas/index.c:3578)()
KeyError: None
The text was updated successfully, but these errors were encountered:
Tested on latest version
The text was updated successfully, but these errors were encountered: