def add_text_label_from_index(df):
 text = []
 for idx in df.index:
  row_text = ''
  if isinstance(idx, tuple):
   for lev in reversed(idx):
    if ((lev is not '') and (row_text == '')):
     row_text = str(lev)
  else:
   row_text = str(idx)
  text.append(row_text)
 df['text'] = text
 return df

def add_text_label_from_index ( df ) : text = [ ] for idx in df . index : row_text = '' if isinstance ( idx , tuple ) : for lev in reversed ( idx ) : if ( ( lev is not '' ) and ( row_text == '' ) ) : row_text = str ( lev ) else : row_text = str ( idx ) text . append ( row_text ) df [ 'text' ] = text return df
add column for text label .