numpy.digitize#

numpy.digitize(x, bins, right=False)