[Numpy-discussion] passing non-flat array to interpolator

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Apr 27 23:37:45 EDT 2010


On Mon, Apr 26, 2010 at 12:04 PM, Thomas <temesgen123 at gmail.com> wrote:
>
>
> I have some problem with interpolators in Scipy
> does anyone knows if there is a way to pass a non-flat
> array variables to Rbf, or other Scipy interpolator
> eg. for my case of 17 x 1 problems of 500 data size
>
> x1.shape = (500,)
> x2.shape = (500,)
> ...
> X17.shape =(500,)
> b = Rbf(x1,x2,x3,...,x17,y)
>
> i would rather create a non-flat variables
> x.shape =(500,17) and pass it to Rbf, or even for all the
> interpolator in Scipy as
>  bf = Rbf(X, Y)
> How can i do this ?  Thank you for your time.
> Thomas

Rbf(*np.c_[X,Y].T)

or

Rbf(*(list(X.T)+[Y]))

I think the second version does not make a copy of the data when
building the list.

It would be easier if the xs and y were reversed in the signature, Rbf(y, *X.T)

Josef


>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list