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 le

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 wrote: > On Mon, Sep 20, 2010 at 3:34 PM, Benjamin Root 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 functi

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 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 a > developer

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 wrote: > On Mon, Sep 20, 2010 at 1:05 PM, Robert Kern 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

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 wrote: > On Mon, Sep 20, 2010 at 1:05 PM, Robert Kern 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

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 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 np.mean() gives the

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Robert Kern
On Sun, Sep 19, 2010 at 12:19, Gökhan Sever 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 = np.zeros((16, 18)) >   

[Numpy-discussion] Question about masked arrays

2010-09-19 Thread Gökhan Sever
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 = np.zeros((16, 18)) all_predicted2 = np.zeros((16, 18)) I do a computation within