how to find unique values in numpy array

number_list = numpy.array([1, 1, 2, 3, 4, 4, 1])
(unique, counts) = numpy.unique(number_list, return_counts=True)

Here is what the above code is Doing:
1. We create a numpy array with some integers.
2. We use the unique function to get the unique values in the array.
3. We use the return_counts parameter to get the number of times each unique value appears in the array.
4. We store the results in two variables: unique and counts.