np.unique
Find the unique elements of an array.
引数
return_inverse
If True, also return the indices of the unique array (for the specified axis, if provided) that can be used to reconstruct ar.
「Trueの場合、arを再構築するために使える一意な配列の添字(与えられた場合は指定された軸について)も返す」
返り値にunique_inverseを追加
The indices to reconstruct the original array from the unique array. Only provided if return_inverse is True.