爲什麼下面的調用griddata失敗?Scipy - 3d griddata - 爲什麼有必要將griddata xi參數轉換爲元組?
import scipy.interpolate
import numpy as np
grid_vals = np.meshgrid(*([np.linspace(-1,1,200)] * 3))
interp_vals = scipy.interpolate.griddata(np.random.randn(50,3), np.random.randn(50), grid_vals, 'linear')
發生以下例外: ValueError異常:在XI維數不匹配X
如果我投的XI(grid_vals)參數元組:
interp_vals = scipy.interpolate.griddata(np.random.randn(50,3), np.random.randn(50), tuple(grid_vals), 'linear')
誤差變爲遠。爲什麼?