[Numpy-discussion] installation problem on Red Hat

2008-10-24 Thread Christoph Göbl
dear members, I'm very sorry to bother you with a (hopefully) simple problem... I need pyhton and the numerical package to run another program. I installed Python, it works fine. But I can't install the numpy package. To install the oder Numeric package was no problem, but I need the newer

Re: [Numpy-discussion] installation problem on Red Hat

2008-10-24 Thread Nadav Horesh
It could be a version mismatch between two gcc (and the corresponding libraries) versions: you surly have gcc at /usr/bin, but the fortran compiler you use (g77) is as /usr/local/bin. Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Christoph G?bl נשלח: ו 24-אוקטובר-08 11:49 אל:

[Numpy-discussion] help to speed up the python code

2008-10-24 Thread frank wang
Hi, I have to send this request second time since my first message contains the attached data file which is too big and was blocked by the system. So this time I will not attach the data file. I have converted a matlab function to python using numpy. both matlab and python run slow. I

[Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Jose Borreguero
Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor line: na=Numeric.array(

Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Travis E. Oliphant
Jose Borreguero wrote: Dear numpy users, I need to pass a Numeric array to some oldie code from a numpy array. I decided to go like this: for i in range(BIGNUMER): my_numpy_array=grabArray(i) na=Numeric.array( my_numpy_array, Numeric.Float) oldie_code(na) The constructor

Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Jose Borreguero
numpy 1.1.0 (from /usr/lib/python2.4/site-packages/numpy/version.py) Numeric 24.2 (from /usr/lib/python2.4/site-packages/Numeric/numeric_version.py) I also tried with an intermediate list, but got the same result: *mylist=list(my_numpy_array) na=Numeric.array( mylist, Numeric.Float)* I don't have

Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Jose Borreguero
My bad. Using the intermediate list does *not* leak. Still, the original problems stays. Can anyone run the following code in their machine and see if they have leaks? Maybe it only happens to me :(* import numpy,Numeric big=1000 na=numpy.array([0.0,]) for i in range(big):

Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Pauli Virtanen
Fri, 24 Oct 2008 14:39:59 -0400, Jose Borreguero wrote: My bad. Using the intermediate list does *not* leak. Still, the original problems stays. Can anyone run the following code in their machine and see if they have leaks? Maybe it only happens to me :(* import numpy,Numeric big=1000

Re: [Numpy-discussion] creating a Numeric array from a numpy array LEAKS memory

2008-10-24 Thread Peter
On Fri, Oct 24, 2008 at 7:52 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: Yep, leaks also here: (Numeric 24.2, numpy 1.2.0) import sys, numpy, Numeric na = numpy.array([0.0]) for i in xrange(100): foo = Numeric.array(na, Numeric.Float) print

[Numpy-discussion] help vectorizing something

2008-10-24 Thread Mathew Yeates
Hi I have 2 vectors A and B. For each value in A I want to find the location in B of the same value. Both A and B have unique elements. Of course I could something like For each index of A: v =A[index] location = numpy.where(B == v) But I have very large lists and it will take too

Re: [Numpy-discussion] help vectorizing something

2008-10-24 Thread Charles R Harris
On Fri, Oct 24, 2008 at 3:48 PM, Mathew Yeates [EMAIL PROTECTED] wrote: Hi I have 2 vectors A and B. For each value in A I want to find the location in B of the same value. Both A and B have unique elements. Of course I could something like For each index of A: v =A[index]

Re: [Numpy-discussion] help vectorizing something

2008-10-24 Thread Mathew Yeates
h. I don't understand the result. If a=array([ 1, 2, 3, 7, 10]) and b=array([ 1, 2, 3, 8, 10]) I want to get the result [0,1,2,4] but[searchsorted(a,b) produces [0,1,2,4,4] ?? and searchsorted(b,a) produces [0,1,2,3,4] ?? Mathew On Fri, Oct 24, 2008 at 3:12 PM, Charles R Harris

Re: [Numpy-discussion] help vectorizing something

2008-10-24 Thread Charles R Harris
On Fri, Oct 24, 2008 at 4:23 PM, Mathew Yeates [EMAIL PROTECTED] wrote: h. I don't understand the result. If a=array([ 1, 2, 3, 7, 10]) and b=array([ 1, 2, 3, 8, 10]) I want to get the result [0,1,2,4] but[searchsorted(a,b) produces [0,1,2,4,4] ?? and searchsorted(b,a) produces