def verify_indices_all_unique(obj):
 axis_names = [('index',), ('index', 'columns'), ('items', 'major_axis', 'minor_axis')][(obj.ndim - 1)]
 for (axis_name, index) in zip(axis_names, obj.axes):
  if index.is_unique:
   continue
  raise ValueError('Duplicate entries in {type}.{axis}: {dupes}.'.format(type=type(obj).__name__, axis=axis_name, dupes=sorted(index[index.duplicated()])))
 return obj

def verify_indices_all_unique ( obj ) : axis_names = [ ( 'index' , ) , ( 'index' , 'columns' ) , ( 'items' , 'major_axis' , 'minor_axis' ) ] [ ( obj . ndim - 1 ) ] for ( axis_name , index ) in zip ( axis_names , obj . axes ) : if index . is_unique : continue raise ValueError ( 'Duplicate entries in {type}.{axis}: {dupes}.' . format ( type = type ( obj ) . __name__ , axis = axis_name , dupes = sorted ( index [ index . duplicated ( ) ] ) ) ) return obj
check that all axes of a pandas object are unique .