Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Pauli Virtanen
Benjamin Root ben.root at ou.edu writes: [clip] a[sl] and a[3:5, 5:14] is equivalent to sl = (slice(3, 5), slice(5, 14)) a[sl] [clip] which is also equivalent to sl = np.s_[3:5, 5:14] ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Daniele Nicolodi
On 12/07/2012 23:32, Chao YUE wrote: Thanks all for the discussion. Actually I am trying to use something like numpy ndarray indexing in the function. Like when I call: func(a,'1:3,:,2:4'), it knows I want to retrieve a[1:3,:,2:4], and func(a,'1:3,:,4') for a[1:3,:,4] ect. I am very close

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Chao YUE
Thanks Daniele. I am writing a small plotting function that can receive the index range as argument value. like I have variables var1, var2, var3, var4, var5 which have exactly the same dimensions. def plot_eg(index_range): #here I need the function above which can use the index_range to

[Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Paul Natsuo Kishimoto
Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was a bug in the behaviour of genfromtxt() https://github.com/numpy/numpy/pull/351 It turns out this alters existing behaviour that some people may depend on,

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Tom Aldcroft
On Fri, Jul 13, 2012 at 11:15 AM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was a bug in the behaviour of genfromtxt()

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Chris Barker
On Thu, Jul 12, 2012 at 2:32 PM, Chao YUE chaoyue...@gmail.com wrote: numpy ndarray indexing in the function. Like when I call: func(a,'1:3,:,2:4'), it knows I want to retrieve a[1:3,:,2:4], and func(a,'1:3,:,4') for a[1:3,:,4] ect. why do the string packing/unpacking? why not use an

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Robert Kern
On Thu, Jul 12, 2012 at 10:32 PM, Chao YUE chaoyue...@gmail.com wrote: Thanks all for the discussion. Actually I am trying to use something like numpy ndarray indexing in the function. Like when I call: func(a,'1:3,:,2:4'), it knows I want to retrieve a[1:3,:,2:4], and func(a,'1:3,:,4') for

[Numpy-discussion] Istalling Numpy and Scipy on preinstalled Python 2.6 on Mac

2012-07-13 Thread Naser Nikandish
Hi, I need to install numpy and scipy on preinstalled Python 2.6 on my Mac Lion. Is there anyway to do it? I am aware that Lion OS comes with Python 2.7 as well. But I have to install it on Python 2.6. I really appreciate any help. Cheers ___

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Paul Natsuo Kishimoto
On Fri, 2012-07-13 at 12:13 -0400, Tom Aldcroft wrote: On Fri, Jul 13, 2012 at 11:15 AM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Chao YUE
Thanks Robert. This is exactly what I want. I have a feeling that there must be something in numpy that can do the job and I didn't know. Thanks again, Chao 2012/7/13 Robert Kern robert.k...@gmail.com On Thu, Jul 12, 2012 at 10:32 PM, Chao YUE chaoyue...@gmail.com wrote: Thanks all for the

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Matthew Brett
On Fri, Jul 13, 2012 at 9:24 AM, Robert Kern robert.k...@gmail.com wrote: On Thu, Jul 12, 2012 at 10:32 PM, Chao YUE chaoyue...@gmail.com wrote: Thanks all for the discussion. Actually I am trying to use something like numpy ndarray indexing in the function. Like when I call: