fronts = np.empty(len(M), int)
frontier_index = 0
while remaining.size > 0:
    dominated = np.any(i_dominates_j[remaining[:, (None)], remaining], axis=0)
fronts[remaining[~dominated]] = frontier_index
remaining = remaining[dominated]
frontier_index += 1
return fronts
Индексы границы Парето с использованием numpy