Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/homework/homework_2018_1_03_1038414799.ipynb
934 views
Kernel: Python 3
%pylab inline import pandas as pd from scipy import interpolate #Defining three random points df=pd.DataFrame({'x': [-4.3,2.5,15.], 'y': [-3.,15.0,12.5] } ) #Plotting the points plt.plot(df.x,df.y, 'go') plt.grid()
Populating the interactive namespace from numpy and matplotlib
/usr/local/lib/python3.4/dist-packages/IPython/core/magics/pylab.py:160: UserWarning: pylab import has clobbered these variables: ['f'] `%matplotlib` prevents importing * from pylab and numpy "\n`%matplotlib` prevents importing * from pylab and numpy"
Image in a Jupyter notebook
#Interpolating the points using KroghInterpolator scipy function f=interpolate.KroghInterpolator([-4.3,2.5,15.],[-3.,15.0,12.5]) #Ploting the funcition and the three points X=np.linspace(-4.3,15.) plt.plot(X,f(X),'b') plt.plot(df.x,df.y, 'go') plt.grid()
Image in a Jupyter notebook