[Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Cera, Tim
I have done this before, but am now really confused. Created an array 'day' specifying the 'f' type In [29]: day Out[29]: array([ 5., 5.], dtype=float32) # Have a mask... In [30]: mask Out[30]: array([ True, False], dtype=bool) # So far, so good... In [31]: day[mask] Out[31]: array([ 5.], dtyp

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Eric Firing
On 2013/08/25 2:30 PM, Cera, Tim wrote: > I have done this before, but am now really confused. > > Created an array 'day' specifying the 'f' type > > In [29]: day > Out[29]: array([ 5., 5.], dtype=float32) > > # Have a mask... > In [30]: mask > Out[30]: array([ True, False], dtype=bool) > > # So f

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Eric Firing
On 2013/08/25 2:30 PM, Cera, Tim wrote: > I have done this before, but am now really confused. > > Created an array 'day' specifying the 'f' type > > In [29]: day > Out[29]: array([ 5., 5.], dtype=float32) > > # Have a mask... > In [30]: mask > Out[30]: array([ True, False], dtype=bool) > > # So f

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Cera, Tim
Figured it out. I created 'day' as a broadcast array. Does this catch other people? Basically changing day[0] would change the entire 'day' array. I guess all other elements of the day array are views of day[0]. Made a copy and everything works as expected. Kindest regards, Tim On Sun, Aug 2

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Cera, Tim
Pardon the noise. The behavior is described right there in the documentation of broadcast_arrays. Kindest regards, Tim On Sun, Aug 25, 2013 at 8:53 PM, Cera, Tim wrote: > Figured it out. I created 'day' as a broadcast array. Does this > catch other people? Basically changing day[0] would cha