code: def bin_number(datapoint, intervals):
    
    index = numpy.searchsorted(intervals, datapoint)
    return [0 if index != i else 1 for i in range(len(intervals) + 1)]
docs: Given a datapoint and intervals representing bins, returns the number
    represented in binned form, where the bin including the value is
    set to 1 and all others are 0.