for k in range(len(Lx)):
    t = 1
for j in range(len(Lx)):
    if j != k:
        t = t * ((X - Lx[j]) / (Lx[k] - Lx[j]))
y += t * Ly[k]
return y
Lagrange interpolation in Python: as a result matematical formula