Re: [Numpy-discussion] Viewer for 2D Numpy arrays (GUI)

2010-09-20 Thread Didrik Pinte
On Fri, Sep 17, 2010 at 8:53 AM, Mayank P Jain mayan...@gmail.com wrote: I thought about these options but what I need is excel like interface that displays the values for each cell and one can modify and save the files. This would be convenient way of saving large files in less space and at

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Robert Kern
On Sun, Sep 19, 2010 at 12:19, Gökhan Sever gokhanse...@gmail.com wrote: Hello, Consider these two sets of container arrays --one defined as usual np array the others as ma arrays:     all_measured = np.ma.zeros((16, 18))     all_predicted = np.ma.zeros((16, 18))     all_measured2 =

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Gökhan Sever
On Mon, Sep 20, 2010 at 1:05 PM, Robert Kern robert.k...@gmail.com wrote: Are you asking about when masked arrays are casted to ndarrays (and thus losing the mask information)? Most times when a function uses asarray() or array() to explicitly cast the inputs to an ndarray. The reason that

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Ryan May
On Mon, Sep 20, 2010 at 3:23 PM, Gökhan Sever gokhanse...@gmail.com wrote: On Mon, Sep 20, 2010 at 1:05 PM, Robert Kern robert.k...@gmail.com wrote: Are you asking about when masked arrays are casted to ndarrays (and thus losing the mask information)? Most times when a function uses asarray()

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Benjamin Root
On Mon, Sep 20, 2010 at 3:23 PM, Gökhan Sever gokhanse...@gmail.com wrote: On Mon, Sep 20, 2010 at 1:05 PM, Robert Kern robert.k...@gmail.comwrote: Are you asking about when masked arrays are casted to ndarrays (and thus losing the mask information)? Most times when a function uses asarray()

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Gökhan Sever
On Mon, Sep 20, 2010 at 3:34 PM, Benjamin Root ben.r...@ou.edu wrote: I have been using masked arrays quite extensively. My take on them is that if a masked array makes sense in that operation, then they should still work with the regular functions. However, there have been many cases where

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Benjamin Root
On Mon, Sep 20, 2010 at 4:03 PM, Gökhan Sever gokhanse...@gmail.com wrote: On Mon, Sep 20, 2010 at 3:34 PM, Benjamin Root ben.r...@ou.edu wrote: I have been using masked arrays quite extensively. My take on them is that if a masked array makes sense in that operation, then they should still

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Pierre GM
On Sep 20, 2010, at 11:09 PM, Benjamin Root wrote: And also if the inner execution could be clarified by asanyarray assertion why there is ma equivalent array operation functions? That is a design question for the numpy gods... Well, asanyarray is not always a panacea, and can lead

[Numpy-discussion] sum of outer products

2010-09-20 Thread Hagen Fürstenau
Hi, I don't know if I'm overlooking something obvious, but is there a compact way of computing the 3-array X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} out of the 2-arrays A, B, and C? - Hagen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] sum of outer products

2010-09-20 Thread Pauli Virtanen
Mon, 20 Sep 2010 23:34:58 +0200, Hagen Fürstenau wrote: I don't know if I'm overlooking something obvious, but is there a compact way of computing the 3-array X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} out of the 2-arrays A, B, and C?

Re: [Numpy-discussion] sum of outer products

2010-09-20 Thread Hagen Fürstenau
X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} (A[:,newaxis,newaxis]*B[newaxis,:,newaxis]*C[newaxis,newaxis,:]).sum(axis=-1) Thanks for the quick solution and practical exercise in broadcasting! :-) However, this creates a temporary 4-array, right? Is there a way of avoiding this memory requirement?