1

I'm using numpy.bincount to find the most common int in an array like this:

labels=np.array([1,2,2,3,4])    
np.bincount(labels).argmax()

But bincount would only accept positive int, is there an alternative for negative integers?

Thanks!

Roy Granit
  • 325
  • 2
  • 20

0 Answers0