'Args:
v(float): value
Returns:
int: the bin index for value ``v``.'

def get_bin(self, v):

    if (v < self.minv):
        log_once('UniformDiscretizer1D:    value    smaller    than    min!', 'warn')
        return 0
    if (v > self.maxv):
        log_once('UniformDiscretizer1D:    value    larger    than    max!', 'warn')
        return (self.nr_bin - 1)
    return int(np.clip(((v - self.minv) / self.spacing), 0, (self.nr_bin - 1)))
