当前位置:网站首页>np.unique() function

np.unique() function

2022-08-02 03:33:00 woshicaiji12138

data = data.valueslis = np.unique(data[:, 1span>])

I encountered the above code today, but I don't know the usage of the np.unique() function. After consulting the data, I found that the function np.unique(array) can remove the repeated numbers in the input array and sort them.
For example:

import numpy as nparray=[1,2,2,3,3,3]lis=np.unique(array)

The output is [1,2,3].

原网站

版权声明
本文为[woshicaiji12138]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020321110499.html