Re: how to get a wrap aound slice of numpy array

2007-04-20 Thread danfan1981
Thanks. I didn't know numpy can do vector indexing as in Matlab. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get a wrap aound slice of numpy array

2007-04-20 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, I am learning Numpy and using it for a course project. Welcome! You might want to ask more numpy questions on the numpy mailing list. Answers to numpy questions here tend to be hit-or-miss. http://www.scipy.org/Mailing_Lists > Suppose x = [0, 1, 2, 3, 4], I know

how to get a wrap aound slice of numpy array

2007-04-20 Thread danfan1981
Hi, I am learning Numpy and using it for a course project. Suppose x = [0, 1, 2, 3, 4], I know that x[0:2] would give [0,1], and x[-1] give [4], is there a way that I can get [4,0,1]. I try x[-1:2], but it returns an empty array. I am doing convolution (e.g. convolve [0, 1, 2, 3, 4] with [1,-2,1])