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 wrote: > On Tue, Aug 17, 2010 at 7:07 PM, Ralf Gommers > wrote: > > > > > > On Wed, Aug 18, 2010 at 12:31 AM, Bruce Southey > wrote: > >> > >> On Tue, Aug 17, 2010 at 10:23 AM, Ralf Gommers > >> wrote: > >> > I am pleased to announce the availabil

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 wrote: > On Wed, Aug 18, 2010 at 12:23 AM, Ralf Gommers > 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 for Python 3, as > > well as for Python

Re: [Numpy-discussion] Problem with loadtxt

2010-08-18 Thread Warren Weckesser
Scott MacDonald wrote: > 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 > > According to that ticket, it is doing int(float(x))

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> wrot

Re: [Numpy-discussion] Problem with loadtxt

2010-08-18 Thread Friedrich Romstedt
2010/8/18 Scott MacDonald : > 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 http://mail.scipy.org/mailman

Re: [Numpy-discussion] fancy indexing question

2010-08-18 Thread Friedrich Romstedt
2010/8/17 Angus McMorland : > 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 ___ NumPy-Discussion maili

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 : > > 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, > > > >numpy.vstack(dat

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, > cre

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 mailto:charlesr.har...@gmail.com>> wrote: On Tue, Aug 17, 2010 at 11:27 AM, Michael Droettboom mailto:md...@stsci.edu>> wrote: I'm getting one unit test error on SunOS 5.8 UltraSP

[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 /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/__u

[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( a>10 )[0][0] 2 but it first compares the entire array and then selects the first index. Is

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

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 1:27 PM, wrote: > On Wed, Aug 18, 2010 at 12:36 PM, Charles R Harris > wrote: >> >> >> On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey wrote: >>> >>> On 08/17/2010 04:34 PM, Charles R Harris wrote: >>> >>> On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey wrote:

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

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 11:27 AM, wrote: > On Wed, Aug 18, 2010 at 12:36 PM, Charles R Harris > wrote: > > > > > > On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey > wrote: > >> > >> On 08/17/2010 04:34 PM, Charles R Harris wrote: > >> > >> On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey > wrote

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 wrote: > > > On Wed, Aug 18, 2010 at 10:02 AM, Bruce Southey wrote: >> >> On 08/17/2010 04:34 PM, Charles R Harris wrote: >> >> On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey wrote: >>> >>>  On 08/16/2010 10:00 PM, Charles R Harris wrote: >>> >

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 wrote: > On 08/17/2010 04:34 PM, Charles R Harris wrote: > > > > On Tue, Aug 17, 2010 at 2:43 PM, Bruce Southey wrote: > >> On 08/16/2010 10:00 PM, Charles R Harris wrote: >> > Hi All, >> > >> > I just added support for Legendre polynomials to n

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 > 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 think the > n

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

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 11:07 AM, David Cournapeau wrote: > On Wed, Aug 18, 2010 at 11:52 PM,   wrote: >> On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris >> wrote: >>> >>> >>> On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald >>> wrote: On 08/18/10 15:14, Charles R Harris wrote:

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

2010-08-18 Thread David Cournapeau
On Wed, Aug 18, 2010 at 11:52 PM, wrote: > On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris > wrote: >> >> >> On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald >> wrote: >>> >>> On 08/18/10 15:14, Charles R Harris wrote: >>> > However, the various constants supplied by numpy, pi and such, are

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

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 10:58 AM, Charles R Harris wrote: > > > On Wed, Aug 18, 2010 at 8:54 AM, Matthieu Brucher > wrote: >> >> I don't think there is longdouble on Windows, is there? >>> np.longdouble >>> np.longdouble(5).itemsize 12 >>> np.double(5).itemsize 8 >> > > The MSVC compilers don

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 Matthieu Brucher
I don't think there is longdouble on Windows, is there? Matthieu 2010/8/18 : > On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris > wrote: >> >> >> On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald >> wrote: >>> >>> On 08/18/10 15:14, Charles R Harris wrote: >>> > However, the various constants

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

2010-08-18 Thread josef . pktd
On Wed, Aug 18, 2010 at 10:36 AM, Charles R Harris wrote: > > > On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald > wrote: >> >> 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 examp

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

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 8:25 AM, Colin Macdonald wrote: > 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. > > Hmm, the full

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 7:37 AM, Colin Macdonald wrote: > On 08/18/10 13:43, Charles R Harris wrote: > > > > > > On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald > > mailto:macdon...@maths.ox.ac.uk>> wrote: > > > > How can I enter longdouble (float96) literals into my python/numpy > > prog

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 ar

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 > 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 this gives >

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 wrote: > Hello list, > > When I do 10**-2, Python nicely returns 0.02 > > But with numpy (

[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] 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 wrote: > > > On Wed, Aug 18, 2010 at 12:18 AM, Christoph Gohlke wrote: > >> >> >> On 8/17/2010 9:56 PM, Charles R Harris wrote: >> > >> > >> > On Tue, Aug 17, 2010 at 9:11 PM, Christoph Gohlke > > > wrote: >> > >> > >> > >>

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 wrote: > > > On 8/17/2010 9:56 PM, Charles R Harris wrote: > > > > > > On Tue, Aug 17, 2010 at 9:11 PM, Christoph Gohlke > > wrote: > > > > > > > > On 8/17/2010 1:02 PM, Charles R Harris wrote: > > > > > > > >

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

2010-08-18 Thread Charles R Harris
On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald wrote: > 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

[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 NumPy-Discussion@scipy.o

[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] 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 ---

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 wrote: > Den 18. aug. 2010 kl. 08.19 skrev Martin Raspaud > : > >> 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 emb

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 : > 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 JVM to run Jython ;)

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 sit