Re: [Numpy-discussion] How to Keep An Array Two Dimensional

2012-11-25 Thread David Warde-Farley
On Sun, Nov 25, 2012 at 9:47 PM, Tom Bennett wrote: > Thanks for the quick response. > > Ah, I see. There is a difference between A[:,:1] and A[:,0]. The former > returns an Mx1 2D array whereas the latter returns an M element 1D array. I > was using A[:,0] in the code but A[:,:1] in the example.

Re: [Numpy-discussion] How to Keep An Array Two Dimensional

2012-11-25 Thread Tom Bennett
Thanks for the quick response. Ah, I see. There is a difference between A[:,:1] and A[:,0]. The former returns an Mx1 2D array whereas the latter returns an M element 1D array. I was using A[:,0] in the code but A[:,:1] in the example. On Sun, Nov 25, 2012 at 8:35 PM, Warren Weckesser < warren.w

Re: [Numpy-discussion] How to Keep An Array Two Dimensional

2012-11-25 Thread Warren Weckesser
On Sun, Nov 25, 2012 at 8:24 PM, Tom Bennett wrote: > Hi, > > I am trying to extract n columns from an 2D array and then operate on the > extracted columns. Below is the code: > > A is an MxN 2D array. > > u = A[:,:n] #extract the first n columns from A > > B = np.dot(u, u.T) #take outer product.

[Numpy-discussion] How to Keep An Array Two Dimensional

2012-11-25 Thread Tom Bennett
Hi, I am trying to extract n columns from an 2D array and then operate on the extracted columns. Below is the code: A is an MxN 2D array. u = A[:,:n] #extract the first n columns from A B = np.dot(u, u.T) #take outer product. This code works when n>1. However, when n=1, u becomes an 1D array i

Re: [Numpy-discussion] adding rfftfreq

2012-11-25 Thread Charles R Harris
On Sun, Nov 25, 2012 at 12:04 PM, Ralf Gommers wrote: > Hi, > > https://github.com/numpy/numpy/pull/484 adds an rfftfreq function to > numpy.fft. Looks logical to me, but before merging I want to check anyway > if no one objects to that. > > No objection here. Chuck __

[Numpy-discussion] adding rfftfreq

2012-11-25 Thread Ralf Gommers
Hi, https://github.com/numpy/numpy/pull/484 adds an rfftfreq function to numpy.fft. Looks logical to me, but before merging I want to check anyway if no one objects to that. Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.s

Re: [Numpy-discussion] numpy where function on different sized arrays

2012-11-25 Thread Siegfried Gonzi
On 25 Nov 2012, at 00:29, numpy-discussion-requ...@scipy.org wrote: > > Message: 3 > Date: Sat, 24 Nov 2012 23:23:36 +0100 > From: Da?id > Subject: Re: [Numpy-discussion] numpy where function on different > sized arrays > To: Discussion of Numerical Python > Message-ID: > > Conte