Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/homework/Homework_2018_1_03_1032478036.ipynb
934 views
Kernel: Python 3
import matplotlib.pyplot as plt %pylab inline import pandas as pd from scipy.interpolate import KroghInterpolator from scipy.interpolate import BarycentricInterpolator
Populating the interactive namespace from numpy and matplotlib
df=pd.DataFrame({'x': [-15.8,0.,19.8], 'y': [-12.,10.,12.]})
plt.plot(df.x,df.y,'bo') plt.grid()
Image in a Jupyter notebook
I=KroghInterpolator(df.x,df.y)
X=np.linspace(-20,35) plt.plot(df.x,df.y,'bo') plt.plot(X,I(X)) plt.grid()
Image in a Jupyter notebook