Re: [Numpy-discussion] Do ufuncs returned by frompyfunc(), have the out arg?

2010-04-06 Thread Ken Basye
From: Anne Archibald On 6 April 2010 15:42, Ken Basye wrote: > Folks, > I hope this is a simple question. When I created a ufunc with > np.frompyfunc(), I got an error when I called the result with an 'out' > argument: In fact, ordinary ufuncs do not accept names for their arguments. T

[Numpy-discussion] numpy build system questions for use in another project (fwrap)

2010-04-06 Thread Kurt Smith
Briefly, I'm encountering difficulties getting things working in numpy distutils for fwrap's build system. Here are the steps I want the build system to accomplish: 1) Compile a directory of Fortran 90 source code -- this works. - The .mod files generated by this compilation step are put in t

Re: [Numpy-discussion] Do ufuncs returned by frompyfunc() have the out arg?

2010-04-06 Thread Anne Archibald
On 6 April 2010 15:42, Ken Basye wrote: > Folks, > I hope this is a simple question. When I created a ufunc with > np.frompyfunc(), I got an error when I called the result with an 'out' > argument: In fact, ordinary ufuncs do not accept names for their arguments. This is annoying, but fixing it

Re: [Numpy-discussion] Possible improvement to numpy.mean()

2010-04-06 Thread Bruce Southey
On 04/06/2010 04:07 PM, Michael Gilbert wrote: > Hi, > > I am applying Monte Carlo for a problem involving mixed deterministic > and random values. In order to avoid a lot of special handling and > corner cases, I am using using numpy arrays full of a single value to > represent the deterministic

[Numpy-discussion] Possible improvement to numpy.mean()

2010-04-06 Thread Michael Gilbert
Hi, I am applying Monte Carlo for a problem involving mixed deterministic and random values. In order to avoid a lot of special handling and corner cases, I am using using numpy arrays full of a single value to represent the deterministic quantities. Anyway, I found that the standard deviation t

Re: [Numpy-discussion] Getting data from NDarrays to Blitz++ and back again

2010-04-06 Thread Fernando Perez
On Sat, Apr 3, 2010 at 2:28 PM, Philip Sterne wrote: > I hope this is the correct place to post my question.  I'd like python to > interface with c++ code that makes heavy use of Blitz++ arrays. After a > day's hacking I appear to have a simple working solution which I am > attaching.  (It uses Bo

[Numpy-discussion] Do ufuncs returned by frompyfunc() have the out arg?

2010-04-06 Thread Ken Basye
Folks, I hope this is a simple question. When I created a ufunc with np.frompyfunc(), I got an error when I called the result with an 'out' argument: >>> def foo(x): return x * x + 1 >>> ufoo = np.frompyfunc(foo, 1, 1) >>> arr = np.arange(9).reshape(3,3) >>> ufoo(arr, out=arr) Traceback (

Re: [Numpy-discussion] Math Library

2010-04-06 Thread Travis Oliphant
On Apr 6, 2010, at 9:08 AM, David Cournapeau wrote: Hi Travis, On Tue, Apr 6, 2010 at 7:43 AM, Travis Oliphant > wrote: I should have some time over the next couple of weeks, and I am very interested in refactoring the NumPy code to separate out the Python interface layer from the "library"

Re: [Numpy-discussion] Math Library

2010-04-06 Thread David Cournapeau
Hi Travis, On Tue, Apr 6, 2010 at 7:43 AM, Travis Oliphant wrote: > > > I should have some time over the next couple of weeks, and I am very > interested in refactoring the NumPy code to separate out the Python > interface layer from the "library" layer as much as possible.   I had > some discuss

Re: [Numpy-discussion] Extracting values from one array corresponding to argmax elements in another array

2010-04-06 Thread josef . pktd
On Tue, Apr 6, 2010 at 9:22 AM, Ken Basye wrote: > From: Vincent Schut > > On 04/05/2010 06:06 PM, Keith Goodman wrote: > > > On Mon, Apr 5, 2010 at 8:44 AM, Ken Basye wrote: > > > Hi Folks, > I have two arrays, A and B, with the same shape. I want to find the > highest values in A along some

Re: [Numpy-discussion] Extracting values from one array corresponding to argmax elements in another array

2010-04-06 Thread Ken Basye
From: Vincent Schut On 04/05/2010 06:06 PM, Keith Goodman wrote: On Mon, Apr 5, 2010 at 8:44 AM, Ken Basye wrote: Hi Folks, I have two arrays, A and B, with the same shape. I want to find the highest values in A along some axis, then extract the corresponding values from B. I can

Re: [Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread Alan G Isaac
On 4/6/2010 6:46 AM, Yogesh Tomar wrote: > import numpy > import numpy.linalg > x=numpy.eye(1000) > for i in range(10): > eigenvalues,eigenvectors=numpy.linalg.eig(x) > eigenvalues,eigenvectors=numpy.linalg.eig(x) > print str(i),'---'* I'm not seeing any

Re: [Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread Yogesh Tomar
I also think the same. There is some problem with my python installation. Because a similar installation python-2.6.4 and numpy-1.3.0 which I did elsewhere does not seg fault for the same code. But I need your help to figure it out. Can you please elaborate on ref count bug? that might help. Rega

Re: [Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread David Cournapeau
On Tue, Apr 6, 2010 at 8:28 PM, Yogesh Tomar wrote: > numpy 1.3.0 also segfaults the same way. I mean building numpy 1.3.0 against python 2.6.1 instead of 2.6.4 - since the crash happen on a python you built by yourself, that's the first thing I would look into before looking into numpy or python

Re: [Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread Yogesh Tomar
numpy 1.3.0 also segfaults the same way. Is it the problem with libc library? Gdb stacktrace. gdb) run /home/eqan/64bit/current/segf.py Starting program: /home/eqan/tapas/64bit/Python/2.6.4_x641/bin/python /home/eqan/64bit/current/segf.py [Thread debugging using libthread_db enabled] [New Threa

Re: [Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread David Cournapeau
On Tue, Apr 6, 2010 at 7:46 PM, Yogesh Tomar wrote: > > Hi all, > > I am getting numpy segmentation fault on a custom install of python to a > prefix. What happens if you build numpy 1.3.0 against python 2.6.1 (instead of your own 2.6.4) ? For numpy, a strace is not really useful (a backtrace fro

Re: [Numpy-discussion] Extracting values from one array corresponding to argmax elements in another array

2010-04-06 Thread Vincent Schut
On 04/05/2010 06:06 PM, Keith Goodman wrote: > On Mon, Apr 5, 2010 at 8:44 AM, Ken Basye wrote: >> Hi Folks, >> I have two arrays, A and B, with the same shape. I want to find the >> highest values in A along some axis, then extract the corresponding >> values from B. I can get the highest val

[Numpy-discussion] Numpy linalg.eig seg faults

2010-04-06 Thread Yogesh Tomar
Hi all, I am getting numpy segmentation fault on a custom install of python to a prefix. I am running this example code. *import numpy import numpy.linalg x=numpy.eye(1000) for i in range(10): eigenvalues,eigenvectors=numpy.linalg.eig(x) eigenvalues,eigenvectors=numpy.linalg.eig(x) p

[Numpy-discussion] Numpy Segmentation Fault

2010-04-06 Thread Yogesh Tomar
Hi all, I am getting numpy segmentation fault on a custom install of python to a prefix. I am running this example code. *import numpy import numpy.linalg x=numpy.eye(1000) for i in range(10): eigenvalues,eigenvectors=numpy.linalg.eig(x) eigenvalues,eigenvectors=numpy.linalg.eig(x) p

Re: [Numpy-discussion] Getting data from NDarrays to Blitz++ and back again

2010-04-06 Thread Philip Sterne
If anyone was interested I found that the easiest solution involved patching up the strides after calling PyArray_SimpleNewFromData(). I still haven't gotten any sort of memory interaction so any objects created by Blitz are deleted by Blitz, while Python objects are deleted by Python. (Irres