[SciPy-User] suddenly no interpolate

Scott Sinclair scott.sinclair.za@gmail....
Wed Nov 24 06:34:58 CST 2010


On 24 November 2010 14:20, John <washakie@gmail.com> wrote:
> I can do this:
>
> from scipy.interpolate import inter2d
>
> but I cannot do this:
>
> interpolator = scipy.interpolate.inter2d(x,y,z)

That's because the sub-packages aren't imported into the main scipy
namespace by default. You need to import what you want explicitly

from scipy import interpolate
interpolator = interpolate.interp2d(x, y, z)

or (as you showed)

from scipy.interpolate import interp2d
interpolator = interp2d(x, y, z)

Cheers,
Scott


More information about the SciPy-User mailing list