#NEWLINE# def dropna( self ) : #NEWLINE# #INDENT# '\n        Return the Categorical without null values.\n\n        Both missing values (-1 in .codes) and NA as a category are detected.\n        NA is removed from the categories if present.\n\n        Returns\n        -------\n        valid : Categorical\n        ' #NEWLINE# result = self [ self . notnull ( ) ] #NEWLINE# if isnull ( result . categories ) . any ( ) : #NEWLINE# #INDENT# result = result . remove_categories ( [ np . nan ] ) #NEWLINE# #UNINDENT# return result