Re: [Numpy-discussion] inconsistent semantics for double-slicing

2011-07-27 Thread Wes McKinney
On Wed, Jul 27, 2011 at 5:36 PM, Alex Flint wrote: > When applying two different slicing operations in succession (e.g. select a > sub-range, then select using a binary mask) it seems that numpy arrays can > be inconsistent with respect to assignment: > For example, in this case an array is modifi

[Numpy-discussion] inconsistent semantics for double-slicing

2011-07-27 Thread Alex Flint
When applying two different slicing operations in succession (e.g. select a sub-range, then select using a binary mask) it seems that numpy arrays can be inconsistent with respect to assignment: For example, in this case an array is modified: In [6]: *A = np.arange(5)* In [8]: *A[:][A>2] = 0* In [