Re: [Numpy-discussion] python array

2014-03-14 Thread Sudheer Joseph
ripod.com *** On Fri, 14/3/14, Eric Firing wrote: Subject: Re: [Numpy-discussion] python array To: numpy-discussion@scipy.org Date: Friday, 14 March, 2014, 7:20 AM On 2014/03/13 9:09 PM, Sudheer Joseph wrote: > Dear Oslen, &

Re: [Numpy-discussion] python array

2014-03-14 Thread Eric Firing
On 2014/03/13 9:09 PM, Sudheer Joseph wrote: > Dear Oslen, > > I had a detailed look at the example you send and points I got were below > > a = np.arange(-8, 8).reshape((4, 4)) > b = ma.masked_array(a, mask=a < 0) > > > Out[33]: b[b<4] > masked_array(data = [-- -- -- -- -- -- -- -- 0 1 2 3], >

Re: [Numpy-discussion] python array

2014-03-14 Thread Sudheer Joseph
and find the percentage of them. Is there a way to get the counts correctly ? that is my botheration now !! with best regards, Sudheer On Fri, 14/3/14, Brett Olsen wrote: Subject: Re: [Numpy-discussion] python array To: "Discussion of Numerical Python" Date: Friday, 14 March

Re: [Numpy-discussion] python array

2014-03-13 Thread Sudheer Joseph
com *** On Fri, 14/3/14, Brett Olsen wrote: Subject: Re: [Numpy-discussion] python array To: "Discussion of Numerical Python" Date: Friday, 14 March, 2014, 2:07 AM The difference appears to be that the boolean selection pulls out all data values <= 0.5 whe

Re: [Numpy-discussion] python array

2014-03-13 Thread Brett Olsen
oppamthadathil.tripod.com > *********** > > > On Thu, 13/3/14, Chris Barker - NOAA Federal > wrote: > > Subject: Re: [Numpy-discussion] python array > To: "Discu

Re: [Numpy-discussion] python array

2014-03-13 Thread Sudheer Joseph
Sorry, The below solution I thoght working was not working but was just giving array size. On Fri, 14/3/14, Sudheer Joseph wrote: Subject: Re: [Numpy-discussion] python array To: "Discussion of Numerical Python" Date: Friday

Re: [Numpy-discussion] python array

2014-03-13 Thread Sudheer Joseph
min()) & (r2010http://oppamthadathil.tripod.com *** On Thu, 13/3/14, Chris Barker - NOAA Federal wrote: Subject: Re: [Numpy-discussion] python array To: "Discussion of Numerical Py

Re: [Numpy-discussion] python array

2014-03-13 Thread Chris Barker - NOAA Federal
On Mar 13, 2014, at 9:39 AM, Nicolas Rougier wrote: > > Seems to be related to the masked values: Good hint -- a masked array keeps the "junk" values in the main array. What "abs" are you using -- it may not be mask-aware. ( you want a numpy abs anyway) Also -- I'm not sure I know what happens

Re: [Numpy-discussion] python array

2014-03-13 Thread Nicolas Rougier
Seems to be related to the masked values: print r2010[:3,:3] [[-- -- --] [-- -- --] [-- -- --]] print abs(r2010)[:3,:3] [[-- -- --] [-- -- --] [-- -- --]] print r2010[ r2010[:3,:3] <0 ] [-- -- -- -- -- -- -- -- --] print r2010[ abs(r2010)[:3,:3] < 0] [] Nicolas On 13 Mar 2014, at 16:5