Despite scipy's documentation indicating that scipy.interpolate.UnivariateSpline will run on order k<=5, under the hood there is an additional constraint for order >=1. Does anyone know of a way to achieve either 0-degree spline or piecewise constant interpolation with Numpy/Scipy?
Asked
Active
Viewed 2,165 times
2 Answers
-1
I have tried a simple trick 1) do numerical integration of step-wise constant function and you will get broken line 2) use 1. degree spline fit 3) calculate a derivative of the spline (method .derivative())
it has worked, but it could be better.

Tomas
- 91
- 2