[SciPy-User] suddenly no interpolate

Scott Sinclair scott.sinclair.za at gmail.com
Wed Nov 24 07:34:58 EST 2010


On 24 November 2010 14:20, John <washakie at 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