When using zero-order interpolation, I found that the last Y value in the input array is not returned for the last value in the X array:
from scipy.interpolate import interp1d
xx = [0.0, 1.0, 2.0]
xi = interp1d(xx, xx, kind='zero')
print(xi(xx))
it seems that it should return [0., 1., 2.], but it returns [0., 1., 1.]. The last value in xx is considered in the interpolation range, but is not returned as the value of the last point. The documentation does not specify details for "zero", but I expect it to be either:
a) raise the value of ValueError, since it is believed that the input values determine the values in the semi-closed ranges [0., 1.) and [1., 2.), thereby leaving 2.0 undefined, or
b) return 2.0, because the ranges [0., 1.), [1., 2.) and [2., 2.)
The interp1d function seems to consider the answer to be correct:
c) returns 1.0 because the last range is a special case defined as a closed interval [1., 2.]
Is there a right choice? If so, is that implemented through interp1d?