Error on entry, no approximation returned. The following conditions
must hold:
1<=k<=5
x[1] < x[2] < ... < x[end]
w[i] > 0.0 for all i

My understanding is that Spline1D does not allow Ev to be non-monotonic. But first I don’t understand why they have this requirement – can’t we do cubic spline on non-monotonic vectors? Second, I was wondering what method I should use for interpolation in this case?

Splines always describe a parameterisation of a curve or surface.

Like a function f(x) cannot have two values for the same x value, a spline cannot have two values for the same input.

If you want to describe an arbitrary curve in 2D, you can do it with a map s: [0,1] \to \mathbb{R}^2 instead where the first component s_1 would describe the non-monotonic X values.

Thank you for the reply. But I’m not sure I get what you mean. What is R^2 supposed to be? Another question is that for each x (sgrid element), I indeed only have 1 value in Ev?