scipy.interpolate.lagrange
scipy.interpolate.lagrange(x, w)
Return a Lagrange interpolating polynomial.
Warning: This implementation is numerically unstable. Do not expect to be able to use more than about 20 points even if they are chosen optimally.
這個函數(shù)看上去倒是很簡單,傳入一組point,然后,返回拉格朗日多項式
這個函數(shù)的返回值有點兒意思,一會兒再研究一下,先看看函數(shù)例子
from scipy.interpolate import lagrange
x = [3 , 6 , 9]
y = [10 , 8 , 4]
lagrange(x , y)
直接調用傳入就行

這個返回的就是多項式了,假設我們現(xiàn)在想要知道某個X值對應的Y值
這樣子就可以了
lagrange(x , y)(3)


如果要看多項式的話,可以先賦值給一個變量
a = lagrange(x , y)
print(a)

關于拉格朗日插值法的理論知識,這里就不說了,因為我沒有什么心得,也就維持在能看懂的階段,哈哈哈
發(fā)現(xiàn)了中文的介紹手冊:
11. SciPy拉格朗日插值