Re: [Numpy-discussion] Possible bug in indexed masked arrays

2010-04-05 Thread Pierre GM
On Apr 5, 2010, at 2:36 PM, Nathaniel Peterson wrote: > Pierre, Thank you for the wonderful explanation. > I get it! np.alltrue(idx.data == idx2.data) is False. > > PS. Thank you for closing ticket #1447; sorry for the trouble. No problem whatsoever. Thanks for your patience...

Re: [Numpy-discussion] Possible bug in indexed masked arrays

2010-04-05 Thread Nathaniel Peterson
Pierre, Thank you for the wonderful explanation. I get it! np.alltrue(idx.data == idx2.data) is False. PS. Thank you for closing ticket #1447; sorry for the trouble. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mail

Re: [Numpy-discussion] Possible bug in indexed masked arrays

2010-04-05 Thread Pierre GM
On Apr 2, 2010, at 1:08 AM, Nathaniel Peterson wrote: > > Is this behavior of masked arrays intended, or is it a bug? It's not a bug, it's an unfortunate side effect of using boolean masked arrays for indices. Don't. Instead, you should fill the masked arrays with either True or False (dependi

[Numpy-discussion] Possible bug in indexed masked arrays

2010-04-01 Thread Nathaniel Peterson
Is this behavior of masked arrays intended, or is it a bug? This part works as I would expected: import numpy as np a=np.ma.fix_invalid(np.array([np.nan,-1,0,1])) b=np.ma.fix_invalid(np.array([np.nan,-1,0,1])) idx=(a==b) print(a[idx][3]) # 1.0 Note that a[idx] has shape (4,). But if I change t