#NEWLINE# def _gotitem( self , key , ndim , subset = None ) : #NEWLINE# #INDENT# '\n        sub-classes to define\n        return a sliced object\n\n        Parameters\n        ----------\n        key : string / list of selections\n        ndim : 1,2\n            requested ndim of result\n        subset : object, default None\n            subset to act on\n        ' #NEWLINE# if ( subset is None ) : #NEWLINE# #INDENT# subset = self . obj #NEWLINE# #UNINDENT# self = self . _shallow_copy ( subset ) #NEWLINE# self . _reset_cache ( ) #NEWLINE# if ( subset . ndim == 2 ) : #NEWLINE# #INDENT# if ( ( isscalar ( key ) and ( key in subset ) ) or com . is_list_like ( key ) ) : #NEWLINE# #INDENT# self . _selection = key #NEWLINE# #UNINDENT# #UNINDENT# return self