Re: [Numpy-discussion] the difference between + and np.add?

2012-11-28 Thread Francesc Alted
On 11/23/12 8:00 PM, Chris Barker - NOAA Federal wrote: On Thu, Nov 22, 2012 at 6:20 AM, Francesc Alted franc...@continuum.io wrote: As Nathaniel said, there is not a difference in terms of *what* is computed. However, the methods that you suggested actually differ on *how* they are computed,

[Numpy-discussion] Conditional update of recarray field

2012-11-28 Thread Bartosz
Hi, I try to update values in a single field of numpy record array based on a condition defined in another array. I found that that the result depends on the order in which I apply the boolean indices/field names. For example: cond = np.zeros(5, dtype=np.bool) cond[2:] = True X =

Re: [Numpy-discussion] Conditional update of recarray field

2012-11-28 Thread Francesc Alted
On 11/28/12 1:47 PM, Bartosz wrote: Hi, I try to update values in a single field of numpy record array based on a condition defined in another array. I found that that the result depends on the order in which I apply the boolean indices/field names. For example: cond = np.zeros(5,

Re: [Numpy-discussion] Conditional update of recarray field

2012-11-28 Thread Bartosz
Thanks for answer, Francesc. I understand now that fancy indexing returns a copy of a recarray. Is it also true for standard ndarrays? If so, I do not understand why X['a'][cond]=-1 should work. Cheers, Bartosz On Wed 28 Nov 2012 03:05:37 PM CET, Francesc Alted wrote: On 11/28/12 1:47 PM,

Re: [Numpy-discussion] Conditional update of recarray field

2012-11-28 Thread Francesc Alted
Hey Bartosz, On 11/28/12 3:26 PM, Bartosz wrote: Thanks for answer, Francesc. I understand now that fancy indexing returns a copy of a recarray. Is it also true for standard ndarrays? If so, I do not understand why X['a'][cond]=-1 should work. Yes, that's a good question. No, in this case

Re: [Numpy-discussion] Conditional update of recarray field

2012-11-28 Thread Bartosz
I got it. Thanks! Now I see why this is non-trivial to fix it. However, it might be also a source of very-hard-to-find bugs. It might be worth discussing this non-intuitive example in the documentation. Cheers, Bartosz Thanks for answer, Francesc. I understand now that fancy indexing

Re: [Numpy-discussion] result shape from dot for 0d, 1d, 2d scalar

2012-11-28 Thread Sebastian Berg
On Wed, 2012-11-28 at 11:11 -0500, Skipper Seabold wrote: On Tue, Nov 27, 2012 at 11:16 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mon, 2012-11-26 at 13:54 -0500, Skipper Seabold wrote: I discovered this because scipy.optimize.fmin_powell appears to

Re: [Numpy-discussion] result shape from dot for 0d, 1d, 2d scalar

2012-11-28 Thread Skipper Seabold
On Wed, Nov 28, 2012 at 12:31 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Maybe a strict matrix product would make sense too, but the dot function behavior cannot be changed in any case, so its pointless to argue about it. Just make sure your arrays are 2-d (or matrices) if you want

[Numpy-discussion] Windows installation problem

2012-11-28 Thread Jim O'Brien
I have tried to install the 1.6.2 win32 superpack on my Windows 7 Pro (64 bit) system which has ActiveState ActivePython 2.7.2.5 (64 bit) installed. However, I get an error that Python 2.7 is required and can't be found in the Registry. I only need numpy as it is a pre-requisite for another

Re: [Numpy-discussion] Windows installation problem

2012-11-28 Thread Ralf Gommers
On Wed, Nov 28, 2012 at 10:16 PM, Jim O'Brien j...@jgssebl.net wrote: ** I have tried to install the 1.6.2 win32 superpack on my Windows 7 Pro (64 bit) system which has ActiveState ActivePython 2.7.2.5 (64 bit) installed. However, I get an error that Python 2.7 is required and can't be found

Re: [Numpy-discussion] Windows installation problem

2012-11-28 Thread Jim O'Brien
Ralf, Thanks. I downloaded the 1.6.2 release for win64 and tried to install. I am still being told that it requires 2.7 and that was not found in the registry. I know I have Python 2.7 as other packages find it just fine. Is there a way to get around the check that is done by the

Re: [Numpy-discussion] Windows installation problem

2012-11-28 Thread Jim O'Brien
Forget the last post. I was one the wrong machine! The 64 bit release installed fine. Regards, Jim _ From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Ralf Gommers Sent: Wed, Nov 28, 2012 2:32 PM To: Discussion of Numerical Python

[Numpy-discussion] Simple Loadtxt question

2012-11-28 Thread Robert Love
I have a file with thousands of lines like this: Signal was returned in 204 microseconds Signal was returned in 184 microseconds Signal was returned in 199 microseconds Signal was returned in 4274 microseconds Signal was returned in 202 microseconds Signal was returned in 189 microseconds I try

Re: [Numpy-discussion] Simple Loadtxt question

2012-11-28 Thread Derek Homeier
On 29.11.2012, at 1:21AM, Robert Love wrote: I have a file with thousands of lines like this: Signal was returned in 204 microseconds Signal was returned in 184 microseconds Signal was returned in 199 microseconds Signal was returned in 4274 microseconds Signal was returned in 202