Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Are you sure that's the first error message? You write

f = scipy.interpolation.interp1d(x, y, kind='cubic')

but the module is "scipy.interpolate", so I don't think this line can be succeeding, and that would explain why f isn't defined afterwards.

FWIW, it works for me:

sage: reset()
sage: import scipy.interpolate
sage: x = [1,2,3,4]
sage: y = [4,5,6,7]
sage: f = scipy.interpolate.interp1d(x,y,kind='cubic')
sage: f(1.0), f(1.5), f(2.0)
(array(3.9999999999999996), array(4.4999999999999982), array(4.9999999999999991))