我沒有得到期望的LinearNDInterpolator二維線性插值功能。下面這段代碼試圖在4個結點(0,0),(1,0),(0,1),(1,1)之間進行插值。 interp2d給了我預期的(線性插值)結果,但LinearNDInterpolator正在做其他事情,我無法弄清楚。也許我沒有正確使用API。不幸的是,我找不到有關使用情況的詳細文檔。有人可以幫助或指向我的正確的論壇(mathoverflow?)寫信給?scipy.interpolate.LinearNDInterpolator不產生所需的功能
>>> 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)
非常感謝! – Ashwin