+3 votes
in Programming Languages by (17.0k points)
I want to find the number of unique elements in a list. What function should I use for it?

1 Answer

0 votes
by (28.9k points)

You can use the unique() function of Numpy to check the unique elements in a list.

>>> s=[1,0,1,2,0,1,1,0,2,2,3,0]
>>> np.unique(s)
array([0, 1, 2, 3])

...