Organizing a Python list of lists as function of number of occurances
Try this code:

def organize_in_decreasing_order(membership_list):
    conlist = np.concatenate(membership_list)
    count = np.bincount(conlist)
    ordered_list = np.argsort(count)[::-1]
    lookup = np.argsort(ordered_list)
    return [[lookup[i] for i in sublist] for sublist in membership_list]


Be aware that the function above returns the organized list, but - in contrast to your implementation - does not change the input argument. You should also be aware that when count has repeated elements, the lists yielded by both implementations may not coincide. The reason for the different behaviour is that ties are dealt with differently.