Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Anne Archibald
2008/5/19 Orest Kozyar <[EMAIL PROTECTED]>: >> If you don't mind fancy indexing, you can convert your index arrays >> into boolean form: >> complement = A==A >> complement[idx] = False > > This actually would work perfectly for my purposes. I don't really > need super-fancy indexing. Heh. Actuall

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Orest Kozyar
> If you don't mind fancy indexing, you can convert your index arrays > into boolean form: > complement = A==A > complement[idx] = False This actually would work perfectly for my purposes. I don't really need super-fancy indexing. >> Given a slice, such as s_[..., :-2:], is it possible to take t

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 9:34 AM, Orest Kozyar <[EMAIL PROTECTED]> wrote: > Given a slice, such as s_[..., :-2:], is it possible to take the > complement of this slice? Specifically, s_[..., ::-2]. Hmm, that doesn't look like the complement. Did you mean s_[..., -2:] and s_[..., :-2]? > I have a

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Anne Archibald
2008/5/19 Orest Kozyar <[EMAIL PROTECTED]>: > Given a slice, such as s_[..., :-2:], is it possible to take the > complement of this slice? Specifically, s_[..., ::-2]. I have a > series of 2D arrays that I need to split into two subarrays via > slicing where the members of the second array are al

[Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Orest Kozyar
Given a slice, such as s_[..., :-2:], is it possible to take the complement of this slice? Specifically, s_[..., ::-2]. I have a series of 2D arrays that I need to split into two subarrays via slicing where the members of the second array are all the members leftover from the slice. The problem