How to count the frequency of unique values using np.unique()

In python, the unique values that exist in the array can easily find out using numpy.unique() function. Syntax numpy.unique(array, return_index=False, return_inverse=False, return_counts=False, axis=None) Example 1 import numpy as np x = np.array([1,1,1,2,2,2,5,25,1,1,2,3,4,2,3,2,3,2,31,3,2,31,2,32,3,3,3,3,3,3,34,4,4,45,5,5,5,5,5]) unique, counts…

0 Comments