#NEWLINE# def _getitem_axis( self , key , axis = 0 ) : #NEWLINE# #INDENT# if self . _should_validate_iterable ( axis ) : #NEWLINE# #INDENT# self . _has_valid_type ( key , axis ) #NEWLINE# #UNINDENT# labels = self . obj . _get_axis ( axis ) #NEWLINE# if isinstance ( key , slice ) : #NEWLINE# #INDENT# return self . _get_slice_axis ( key , axis = axis ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( is_list_like_indexer ( key ) and ( not ( isinstance ( key , tuple ) and isinstance ( labels , MultiIndex ) ) ) ) : #NEWLINE# #INDENT# if ( hasattr ( key , 'ndim' ) and ( key . ndim > 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Cannot index with multidimensional key' ) #NEWLINE# #UNINDENT# return self . _getitem_iterable ( key , axis = self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# key = labels . _maybe_cast_indexer ( key ) #NEWLINE# if is_integer ( key ) : #NEWLINE# #INDENT# if ( ( axis == 0 ) and isinstance ( labels , MultiIndex ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return self . _get_label ( key , axis = axis ) #NEWLINE# #UNINDENT# except ( KeyError , TypeError ) : #NEWLINE# #INDENT# if self . obj . index . levels [ 0 ] . is_integer ( ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not labels . is_floating ( ) ) and ( not labels . is_integer ( ) ) ) : #NEWLINE# #INDENT# return self . _get_loc ( key , axis = axis ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _get_label ( key , axis = axis )