How to count frequency of a element in numpy array?
问题 I have a 3 D numpy array which contains elements with repetition. counterTraj.shape (13530, 1, 1 For example counterTraj contains such elements: I have shown few elements only: array([[[136.]], [[129.]], [[130.]], ..., [[103.]], [[102.]], [[101.]]]) ``` I need to find frequency of different element: Example: 136 count 5 (say), 101 count 12 (say). The array elements are not fixed and changes with input data. I try following: from collections import Counter Counter(counterTraj) Following error