Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy array unique value counts

import numpy as np

x = np.array([1,1,1,2,2,2,5,25,1,1])
unique, counts = np.unique(x, return_counts=True)

print np.asarray((unique, counts)).T
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #numpy #array #unique #counts
ADD COMMENT
Topic
Name
5+8 =