Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Christoph Gohlke
On 8/17/2010 9:56 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 9:11 PM, Christoph Gohlke cgoh...@uci.edu mailto:cgoh...@uci.edu wrote: On 8/17/2010 1:02 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 1:38 PM, Christoph Gohlke cgoh...@uci.edu

Re: [Numpy-discussion] [SciPy-Dev] Good-bye, sort of (John Hunter)

2010-08-18 Thread Martin Raspaud
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Goldsmith skrev: Ahh, cell arrays, they bring back memories. Makes you pine for a dictionary, no? JDH Not to mention writeline, readline, string concatenation using +, English wording of loops, list comprehension,

Re: [Numpy-discussion] Problems building NumPy with GotoBLAS

2010-08-18 Thread Eloi Gaudry
Peter, As mentionned, you need to replace the values of GOTODIR, LAPACKDIR and PYTHONDIR in this script with the ones matching your environment. Eloi On Wednesday 18 August 2010 00:39:48 ashf...@whisperpc.com wrote: Eloi, please below a script that will build numpy using a relevant

Re: [Numpy-discussion] [SciPy-Dev] Good-bye, sort of (John Hunter)

2010-08-18 Thread Sturla Molden
Den 18. aug. 2010 kl. 08.19 skrev Martin Raspaud martin.rasp...@smhi.se: Once upon a time, when my boss wanted me to use matlab, I found myself implementing a python interpreter in matlab... There are just two sane solutions for Matlab: Either embed CPyton in a MEX file, or use Matlab's

Re: [Numpy-discussion] [SciPy-Dev] Good-bye, sort of (John Hunter)

2010-08-18 Thread Robin
On Wed, Aug 18, 2010 at 8:20 AM, Sturla Molden stu...@molden.no wrote: Den 18. aug. 2010 kl. 08.19 skrev Martin Raspaud martin.rasp...@smhi.se: Once upon a time, when my boss wanted me to use matlab, I found myself implementing a python interpreter in matlab... There are just two sane

[Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
How can I enter longdouble (float96) literals into my python/numpy programs? In C, I would postfix such numbers with 'L', but this gives a SyntaxError in python. The rest of my message is just two examples of what I'm talking about in case its not clear. Thanks, Colin

[Numpy-discussion] clip applied to complex gives unexpected results

2010-08-18 Thread Neal Becker
The results of clip applied to complex values is surprising and not documented (AFAICT) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] inconsistency in 10**(-2) or 10**array([-2])

2010-08-18 Thread Mark Bakker
Hello list, When I do 10**-2, Python nicely returns 0.02 But with numpy (version 1.3.0), I get zero: In [492]: 10**array([-2]) Out[492]: array([0]) Is this the intended behavior? Thanks, Mark ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald macdon...@maths.ox.ac.ukwrote: How can I enter longdouble (float96) literals into my python/numpy programs? In C, I would postfix such numbers with 'L', but this gives a SyntaxError in python. The rest of my message is just two examples of

Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 12:18 AM, Christoph Gohlke cgoh...@uci.edu wrote: On 8/17/2010 9:56 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 9:11 PM, Christoph Gohlke cgoh...@uci.edu mailto:cgoh...@uci.edu wrote: On 8/17/2010 1:02 PM, Charles R Harris wrote:

Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 6:50 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 12:18 AM, Christoph Gohlke cgoh...@uci.eduwrote: On 8/17/2010 9:56 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 9:11 PM, Christoph Gohlke cgoh...@uci.edu

[Numpy-discussion] Evaluating performance of f2py extensions with gprof, why spending time _gfortran_compare_string

2010-08-18 Thread Åsmund Hjulstad
I am calling a few functions in a fortran library. All parameters are short (longest array of 20 elements), and I do three calls to the fortran library pr iteration. According to the python profiler (running the script as %run -p in ipython), all time is spent in the python extension. I built the

Re: [Numpy-discussion] inconsistency in 10**(-2) or 10**array([-2])

2010-08-18 Thread Roberto De Almeida
Hi, Mark. I think the problem is that array([-2]) is an array of integers, so the result is also an array of integers. It works fine with array([-2.0]). --Rob On Wed, Aug 18, 2010 at 9:42 AM, Mark Bakker mark...@gmail.com wrote: Hello list, When I do 10**-2, Python nicely returns 0.02 But

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
On 08/18/10 13:43, Charles R Harris wrote: On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald macdon...@maths.ox.ac.uk mailto:macdon...@maths.ox.ac.uk wrote: How can I enter longdouble (float96) literals into my python/numpy programs? In C, I would postfix such numbers with 'L', but

Re: [Numpy-discussion] inconsistency in 10**(-2) or 10**array([-2])

2010-08-18 Thread Mark Bakker
I understand why numpy does it, but even Python itself gives 10**-2 = 0.01. So I am wondering whether this is the intended behavior of numpy. I don't really think so, but I may be wrong. Roberto wrote: I think the problem is that array([-2]) is an array of integers, so the result is also an

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 7:37 AM, Colin Macdonald macdon...@maths.ox.ac.ukwrote: On 08/18/10 13:43, Charles R Harris wrote: On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald macdon...@maths.ox.ac.uk mailto:macdon...@maths.ox.ac.uk wrote: How can I enter longdouble (float96)

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
On 08/18/10 15:14, Charles R Harris wrote: However, the various constants supplied by numpy, pi and such, are full precision. no, they are not. My example demonstrated that numpy.pi is only double precision. Thanks for your help so far. Colin ___

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald macdon...@maths.ox.ac.ukwrote: On 08/18/10 15:14, Charles R Harris wrote: However, the various constants supplied by numpy, pi and such, are full precision. no, they are not. My example demonstrated that numpy.pi is only double precision.

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald macdon...@maths.ox.ac.uk wrote: On 08/18/10 15:14, Charles R Harris wrote: However, the various constants supplied by numpy, pi and such, are full

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Matthieu Brucher
I don't think there is longdouble on Windows, is there? Matthieu 2010/8/18 josef.p...@gmail.com: On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald macdon...@maths.ox.ac.uk wrote: On 08/18/10 15:14,

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 8:54 AM, Matthieu Brucher matthieu.bruc...@gmail.com wrote: I don't think there is longdouble on Windows, is there? The MSVC compilers don't support extended precision, or rather, long doubles are the same as doubles. I don't know what other compilers on windows do.

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 10:58 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 8:54 AM, Matthieu Brucher matthieu.bruc...@gmail.com wrote: I don't think there is longdouble on Windows, is there? np.longdouble type 'numpy.float96' np.longdouble(5).itemsize 12

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread David Cournapeau
On Wed, Aug 18, 2010 at 11:52 PM, josef.p...@gmail.com wrote: On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald macdon...@maths.ox.ac.uk wrote: On 08/18/10 15:14, Charles R Harris wrote: However, the

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 11:07 AM, David Cournapeau courn...@gmail.com wrote: On Wed, Aug 18, 2010 at 11:52 PM,  josef.p...@gmail.com wrote: On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread Bruce Southey
On 08/17/2010 04:34 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey bsout...@gmail.com mailto:bsout...@gmail.com wrote: On 08/16/2010 10:00 PM, Charles R Harris wrote: Hi All, I just added support for Legendre polynomials to numpy and I

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey bsout...@gmail.com wrote: On 08/17/2010 04:34 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey bsout...@gmail.com wrote: On 08/16/2010 10:00 PM, Charles R Harris wrote: Hi All, I just added support for

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey bsout...@gmail.com wrote: On 08/17/2010 04:34 PM, Charles R Harris wrote: On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey bsout...@gmail.com wrote:  On

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 11:27 AM, josef.p...@gmail.com wrote: On Wed, Aug 18, 2010 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey bsout...@gmail.com wrote: On 08/17/2010 04:34 PM, Charles R Harris wrote: On Tue, Aug

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 1:27 PM, josef.p...@gmail.com wrote: On Wed, Aug 18, 2010 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey bsout...@gmail.com wrote: On 08/17/2010 04:34 PM, Charles R Harris wrote: On Tue, Aug 17, 2010

[Numpy-discussion] index of the first element fulfilling a condition?

2010-08-18 Thread Johann Bauer
Hi, is there a good method to find the index of the first element in a 1D array fulfilling a condition? The following does the job import numpy a = numpy.array([1,5,78,3,12,4]) numpy.where( a10 )[0][0] 2 but it first compares the entire array and then selects the first index. Is there a

[Numpy-discussion] add NPY_UNUSED to _import_{array|umath}

2010-08-18 Thread Lisandro Dalcin
When using gcc -Wall, the warnings below are common when including NumPy headers (e.g. Cython testsuite) /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:968: warning: ‘_import_array’ defined but not used

Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Michael Droettboom
On 08/17/2010 08:10 PM, Ralf Gommers wrote: On Wed, Aug 18, 2010 at 3:08 AM, Charles R Harris charlesr.har...@gmail.com mailto:charlesr.har...@gmail.com wrote: On Tue, Aug 17, 2010 at 11:27 AM, Michael Droettboom md...@stsci.edu mailto:md...@stsci.edu wrote: I'm getting

Re: [Numpy-discussion] Seeking advice on crowded namespace.

2010-08-18 Thread David Warde-Farley
On 2010-08-18, at 12:36 PM, Charles R Harris wrote: In general it is a good idea to keep the specific bits out of classes since designing *the* universal class is hard and anyone who wants to just borrow a bit of code will end up cursing the SOB who buried the good stuff in a class,

Re: [Numpy-discussion] numpy.concatenate slower than slice copying

2010-08-18 Thread Zbyszek Szmek
On Wed, Aug 18, 2010 at 02:06:51AM +0100, Francesc Alted wrote: Hey Zbyszek, 2010/8/17, Zbyszek Szmek zbys...@in.waw.pl: Hi, this is a problem which came up when trying to replace a hand-written array concatenation with a call to numpy.vstack: for some array sizes,

Re: [Numpy-discussion] fancy indexing question

2010-08-18 Thread Friedrich Romstedt
2010/8/17 Angus McMorland amcm...@gmail.com: a = np.random.randint(10, size=(4,3,2)) ord = np.array([[3,2,1,0],[0,2,1,3],[3,0,2,1]]).T b = a[ord][:,np.eye(3, dtype=bool),:] b = a[ord, arange(0, 3)] Broadcasting rules! Tested. Friedrich ___

Re: [Numpy-discussion] Problem with loadtxt

2010-08-18 Thread Friedrich Romstedt
2010/8/18 Scott MacDonald scott.p.macdon...@gmail.com: In [42]: c = StringIO(5399354557888517120) Well, should't it be StringIO(5399354557888517312)? Maybe I'm missing sth. Friedrich ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Problem with loadtxt

2010-08-18 Thread Scott MacDonald
Yes it should, sorry I must have copied and pasted wrong. I did some more research and found this bug report: http://projects.scipy.org/numpy/ticket/1163 I guess this is still open? I am using numpy 1.4.1 On Wed, Aug 18, 2010 at 2:42 PM, Friedrich Romstedt friedrichromst...@gmail.com

Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Ralf Gommers
On Wed, Aug 18, 2010 at 9:28 AM, David Cournapeau courn...@gmail.comwrote: On Wed, Aug 18, 2010 at 12:23 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: I am pleased to announce the availability of the second beta of NumPy 1.5.0. This will be the first NumPy release to include support

Re: [Numpy-discussion] ANN: NumPy 1.5.0 beta 2

2010-08-18 Thread Ralf Gommers
On Wed, Aug 18, 2010 at 9:32 AM, Bruce Southey bsout...@gmail.com wrote: On Tue, Aug 17, 2010 at 7:07 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Aug 18, 2010 at 12:31 AM, Bruce Southey bsout...@gmail.com wrote: On Tue, Aug 17, 2010 at 10:23 AM, Ralf Gommers