The function has this mathematical form
f(x) = 1, if x<1
= g(x), for 1<=x<10
= 0, for x >=10
where g(x) is a simple function.
It is straightforward to write such a function if the input is a float using if/else. If the input is a numpy array, is there a neat/efficient implementation without explicit loop?
