#NEWLINE# def to_index( self ) : #NEWLINE# #INDENT# 'Convert this variable to a pandas.Index' #NEWLINE# assert ( self . ndim == 1 ) #NEWLINE# index = self . _data_cached ( ) . array #NEWLINE# if ( not isinstance ( index , pd . MultiIndex ) ) : #NEWLINE# #INDENT# index = index . set_names ( self . name ) #NEWLINE# #UNINDENT# return self