I seem to get different answers while using scipy interp2d function and LinearNDInterpolator function. I don't understand why. When I calculate it manually, the interpolation using interp2d function seems to be correct. I am calculating for point [0.7,25]
Please help with clarification, the code is below
# -*- coding: utf-8 -*-
"""
Created on Tue May 23 11:03:14 2023
@author: manuelma
"""
from scipy.interpolate import interp2d
from scipy.interpolate import LinearNDInterpolator
### a is a list with x,y values
a=[[0.6, 20], [0.6, 30], [0.8, 20], [0.8, 30]]
### b is a list with z values
b=[1.71, 1.43, 1.57, 1.44]
target_2dinterp=interp2d(list(i[0] for i in a), list(i[1] for i in a), b, kind='linear')
target_lndinterp=LinearNDInterpolator(a,b)
b1=target_2dinterp(0.7,25)
b2=target_lndinterp([0.7,25])