Differentiate a 2d cubic spline in python
问题 I'm using interpolate.interp2d() to fit a 2-D spline over a function. How can I get the first derivative of the spline w.r.t. each of the dependent variables? Here is my code so far, Z are the descrete points on a mesh-grid that I have from scipy import interpolate YY, XX = np.meshgrid(Y, X) f = interpolate.interp2d(AA, XX, Z, kind='cubic') So, I need df/dx and df/dy. Note also that my Y-grid is not evenly spaced. I guess I can numerically differentiate Z and then fit a new spline, but it