numpy How many distinct values in array? April 30, 2021 Learn how to calculate frequency of distinct values in NumPy arrays using np.unique() with return_counts parameter.