Menu

[r3313]: / trunk / py4science / book / examples / scipy / example6.1  Maximize  Restore  History

Download this file

19 lines (13 with data), 382 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
>>> x = arange(0,10)
>>> y = exp(-x/3.0)
>>> f = interpolate.linear_1d(x,y)
>>> help(f)
Instance of class: linear_1d
<name>(x_new)
Find linearly interpolated y_new = <name>(x_new).
Inputs:
x_new -- New independent variables.
Outputs:
y_new -- Linearly interpolated values corresponding to x_new.
>>> xnew = arange(0,9,0.1)
>>> xplt.plot(x,y,'x',xnew,f(xnew),'.')
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.