I am not getting the desired 2D linear interpolation functionality with LinearNDInterpolator. The following piece of code is trying to do an interpolation between the 4 knot points (0,0), (1,0), (0,1), (1,1). interp2d gives me the expected (linear-interpolated) result but LinearNDInterpolator is doing something else, which I am unable to figure out. Perhaps I am not using the API correctly. Unfortunately, I can't find detailed docs on the usage. Can someone please help or point me to the right forum (mathoverflow ?) to write to ?
>>> f = interp2d([0,1,0,1], [0,0,1,1], [0,1,2,4])
>>> f(0.5,0.5)
array([ 1.75])
>>> g = LinearNDInterpolator([[0,0],[1,0],[0,1],[1,1]], [0,1,2,4])
>>> g(0.5,0.5)
array(2.0)