Returns the position of a number in the specified array (this is called bin).
■Concrete example
import numpy as np
a=np.random.uniform(0,100,5) # Create an array with 5 numbers from 0 to 100
print(a)
⇒ array([18.20175387, 68.02698607, 43.08681255, 45.76519616, 11.87886015])
b=np.digitize(a, bins=[15, 30, 45, 50, 60])
print(b)
⇒ array([1, 5, 2, 3, 0], dtype=int64)