[SciPy-User] Inconsistent conventions in scipy.interpolate
Armando Serrano Lombillo
Wed Oct 31 09:59:13 CDT 2012
On Tue, Oct 30, 2012 at 9:39 PM, Pauli Virtanen <firstname.lastname@example.org> wrote:
> 30.10.2012 12:08, Armando Serrano Lombillo kirjoitti:
> > I've recently been catched by the fact that
> > scipy.interpolate.interp2d(x, y, z) expects z.shape=(len(y), len(x))
> > while scipy.interpolate.RectBivariateSpline(x, y, z) expects
> > z.shape=(len(x), len(y)). I find this inconsistency quite annoying and
> > error prone, is there a reason for it?
> No reason I'm aware of. The "transposed" convention comes from how
> meshgrid and probably ultimately comes from image processing or so,
> whereas the other convention is more natural for Numpy.
> I would suggest avoiding using interp2d --- use RectBivariateSpline if
> you want to fit splines to rectangular array data,
> Smooth/LSQBivariateSpline if you want to do spline fitting to scattered
> data, and griddata for scattered data interpolation.
> Pauli Virtanen
> SciPy-User mailing list
If interp2d should be avoided, then, shouldn't it be deprecated so that
future unsuspecting users use the most appropriate functions?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User