这个 numpy 函数发生了什么: https ://numpy.org/doc/stable/reference/generated/numpy.unique.html
a = np.array([1, 2, 5, 3, 2])
u, indices = np.unique(a, return_inverse=True)
结果是:
u
数组([1, 2, 3, 5)]
indices
数组([0,1,3,2,1),dtype=int64)
u[indices]
数组([1, 2, 5, 3, 1])
u 是此数组中的单个值。什么是指数?为什么是3而不是5?u[indices] 中发生了什么?