Re: [Numpy-discussion] shuffle a slice

2010-05-29 Thread Keith Goodman
On Sat, May 29, 2010 at 11:45 AM, Robert Kern wrote: > On Sat, May 29, 2010 at 13:35, Keith Goodman wrote: >> np.random.shuffle: "Modify a sequence in-place by shuffling its contents." >> >> Matches doc string: >> a = np.arange(10) np.random.shuffle(a[:-1]) a >>   array([0, 7, 8, 4

Re: [Numpy-discussion] shuffle a slice

2010-05-29 Thread Robert Kern
On Sat, May 29, 2010 at 13:35, Keith Goodman wrote: > np.random.shuffle: "Modify a sequence in-place by shuffling its contents." > > Matches doc string: > >>> a = np.arange(10) >>> np.random.shuffle(a[:-1]) >>> a >   array([0, 7, 8, 4, 3, 6, 2, 1, 5, 9]) > > Doesn't match doc string: > >>> l = ran

[Numpy-discussion] shuffle a slice

2010-05-29 Thread Keith Goodman
np.random.shuffle: "Modify a sequence in-place by shuffling its contents." Matches doc string: >> a = np.arange(10) >> np.random.shuffle(a[:-1]) >> a array([0, 7, 8, 4, 3, 6, 2, 1, 5, 9]) Doesn't match doc string: >> l = range(10) >> np.random.shuffle(l[:-1]) >> l [0, 1, 2, 3, 4, 5, 6, 7,