Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Return the indices of the bins

import numpy as np 

x = np.array([0.2, 6.4, 3.0, 1.6])
bins = np.array([0.0, 1.0, 2.5, 4.0, 10.0])

out = np.digitize(x,bins=bins)
 
PREVIOUS NEXT
Tagged: #Return #indices #bins
ADD COMMENT
Topic
Name
7+5 =