December 2017
Intermediate to advanced
386 pages
10h 42m
English
We have the following example:
%pylab inlinefrom scipy.interpolate import CubicSplineimport matplotlib.pyplot as pltx = np.arange(10)y = np.sin(x)cs = CubicSpline(x, y)xs = np.arange(-0.5, 9.6, 0.1)plt.figure(figsize=(6.5, 4))plt.plot(x, y, 'o', label='data')plt.plot(xs, np.sin(xs), label='true')plt.plot(xs, cs(xs), label="S")plt.plot(xs, cs(xs, 1), label="S'")plt.plot(xs, cs(xs, 2), label="S''")plt.plot(xs, cs(xs, 3), label="S'''")plt.xlim(-0.5, 9.5)plt.legend(loc='lower left', ncol=2)plt.show()
We can see the result here:

We see the next example:
theta = 2 * np.pi * np.linspace(0, 1, 5) y = np.c_[np.cos(theta), np.sin(theta ...
Read now
Unlock full access