# How to count the frequency of unique values in NumPy array in Python # import libraryimport numpy as np  ini_array = np.array([10, 20, 5,                      10, 8, 20,                      8, 9])  # Get a tuple of unique values # and their frequency in# numpy arrayunique, frequency = np.unique(ini_array,                               return_counts = True)# print unique values arrayprint("Unique Values:",       unique)  # print frequency arrayprint("Frequency Values:",      frequency)