I was originally going to show you what the difference is for 2d interpolation if your input data is oriented along the coordinate axes, and not in some general direction, but it turns out that the result will be even more messy than I expected. I tried using a random dataset over an interpolated rectangular grid and compared this to the case when the same x and y coordinates were rotated 45 degrees for interpolation. The result was terrible.
Then I tried to make a comparison with a smoother dataset: it turns out scipy.interpolate.interp2d has a lot of problems. Therefore, my bottom line will be "use scipy.interpolate.griddata ".
For instructive purposes, here is my (rather dirty) code:
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.cm as cm n = 10
So here is the results gallery. Using data from random input z and interp2d , Cartesian (left) and rotational interpolation (right):

Pay attention to the terrible scale on the right side, noting that the input points are between 0 and 1 . Even his mother does not recognize the data set. Note that while evaluating a rotating dataset there are warnings at runtime, so we warn that all this shit.
Now do the same with griddata :

It should be noted that these numbers are much closer to each other, and they seem to make more sense than the output of interp2d . For example, pay attention to overshoot on the scale of the very first digit.
These artifacts always occur between input data points. Since it is still interpolation, the input points must be reproduced using the interpolation function, but it is rather strange that the linear interpolation function is overshoot between the data points. It is clear that griddata does not suffer from this problem.
Consider an even clearer case: another set of z values ββthat are smooth and deterministic. Surfaces with interp2d :

HELP! Call the interpolation police! Already in the Cartesian input case, inexplicable (well, at least by me) false signs in it, and a rotating input case poses a threat s g Μ»ΝΝΝΜΜ»ΝΝ«ΝΜ
ΝΝ o ΝΝΜ±Μ₯ΜΜ«ΝΜΎΝ.
So do the same with griddata :

The day is saved thanks to The Powerpuff Girls scipy.interpolate.griddata . Homework: check the same with cubic interpolation.
By the way, a very short answer to your original question is in help(interp.interp2d) :
| Notes | ----- | The minimum number of data points required along the interpolation | axis is ``(k+1)**2``, with k=1 for linear, k=3 for cubic and k=5 for | quintic interpolation.
For linear interpolation, you need at least 4 points along the interpolation axis, i.e. at least 4 unique x and y values ββmust be present to get a meaningful result. Check them out:
nvals = 3 # -> RuntimeWarning x = np.linspace(0,1,10) y = np.random.randint(low=0,high=nvals,size=x.shape) z = x interp.interp2d(x,y,z) nvals = 4 # -> no problem here x = np.linspace(0,1,10) y = np.random.randint(low=0,high=nvals,size=x.shape) z = x interp.interp2d(x,y,z)
And, of course, all this connects you with the following question: it is of great importance if your geometrically 1d-data set is located along one of the Cartesian axes or if it is generally such that the coordinate values ββtake different values. It is probably pointless (or at least very poorly defined) to try 2d interpolation from a geometrically 1d data set, but at least the algorithm should not be interrupted if your data is along the general direction of the x,y .