#NEWLINE# def argsort( self , ascending = True , **kwargs ) : #NEWLINE# #INDENT# ' Implements ndarray.argsort.\n\n        For internal compatibility with numpy arrays.\n\n        Only ordered Categoricals can be argsorted!\n\n        Returns\n        -------\n        argsorted : numpy array\n        ' #NEWLINE# result = np . argsort ( self . _codes . copy ( ) , ** kwargs ) #NEWLINE# if ( not ascending ) : #NEWLINE# #INDENT# result = result [ : : ( - 1 ) ] #NEWLINE# #UNINDENT# return result