@@ -866,16 +866,7 @@ def _validate_key(self, key, axis: int):
866866 # slice of labels (where start-end in labels)
867867 # slice of integers (only if in the labels)
868868 # boolean
869-
870- if isinstance (key , slice ):
871- return
872-
873- if com .is_bool_indexer (key ):
874- return
875-
876- if not is_list_like_indexer (key ):
877- labels = self .obj ._get_axis (axis )
878- labels ._convert_scalar_indexer (key , kind = "loc" )
869+ pass
879870
880871 def _has_valid_setitem_indexer (self , indexer ) -> bool :
881872 return True
@@ -1139,15 +1130,6 @@ def _convert_to_indexer(self, key, axis: int, is_setter: bool = False):
11391130 if isinstance (key , slice ):
11401131 return labels ._convert_slice_indexer (key , kind = "loc" )
11411132
1142- if is_scalar (key ):
1143- # try to find out correct indexer, if not type correct raise
1144- try :
1145- key = labels ._convert_scalar_indexer (key , kind = "loc" )
1146- except KeyError :
1147- # but we will allow setting
1148- if not is_setter :
1149- raise
1150-
11511133 # see if we are positional in nature
11521134 is_int_index = labels .is_integer ()
11531135 is_int_positional = is_integer (key ) and not is_int_index
@@ -2029,11 +2011,17 @@ def _convert_key(self, key, is_setter: bool = False):
20292011 if is_setter :
20302012 return list (key )
20312013
2032- lkey = list (key )
2033- for n , (ax , i ) in enumerate (zip (self .obj .axes , key )):
2034- lkey [n ] = ax ._convert_scalar_indexer (i , kind = "loc" )
2014+ return key
20352015
2036- return tuple (lkey )
2016+ def __getitem__ (self , key ):
2017+ if self .ndim != 1 or not is_scalar (key ):
2018+ # FIXME: is_scalar check is a kludge
2019+ return super ().__getitem__ (key )
2020+
2021+ # Like Index.get_value, but we do not allow positional fallback
2022+ obj = self .obj
2023+ loc = obj .index .get_loc (key )
2024+ return obj .index ._get_values_for_loc (obj , loc , key )
20372025
20382026
20392027@Appender (IndexingMixin .iat .__doc__ )
0 commit comments