def _index_to_label(index):
 if isinstance(index, pd.MultiIndex):
  return '-'.join(map(str, index.names))
 else:
  return index.name

def _index_to_label ( index ) : if isinstance ( index , pd . MultiIndex ) : return '-' . join ( map ( str , index . names ) ) else : return index . name
convert a pandas index or multiindex to an axis label .