You can count unique values in the NumPy array with the following code. If you want to learn Python, I highly recommend reading This Book.

import numpy as np a = np.array([5, 10, 5, 5, 15, 10, 5]) (unique, counts) = np.unique(a, return_counts=True) print(unique, counts)
Output
[ 5 10 15] [4 2 1]
People are also reading:
What is Computer Vision? Examples, Applications, Techniques
Books for Machine Learning (ML)