Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Travis Oliphant
Brian Granger wrote: > Hi, > > i am running numpy on aix compiling with xlc. Revision 1.0rc2 works > fine and passes all tests. But 1.0rc3 and more recent give the > following on import: > Most likely the error-detection code is not working on your platform. The platform dependent stuff i

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
Thanks, I will investigate more on these things and get back to you early in the week. But for now numpy seems to be functioning pretty normally (log(2) gives the correct answer). thanks again. It would be great to figure this stuff out before 1.0, but we might not have time. Brian On 10/20/06

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Tim Hochberg
Brian Granger wrote: > Tim, > > I just tried everything with r3375. I set seterr(all='warn') and the > tests passed. But all the floating point warning are still there. > With seterr(all='ignore') the warnings go away and all the tests pass. > should I worry about the warnings? > Maybe. I jus

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
Tim, I just tried everything with r3375. I set seterr(all='warn') and the tests passed. But all the floating point warning are still there. With seterr(all='ignore') the warnings go away and all the tests pass. should I worry about the warnings? thanks Brian On 10/20/06, Tim Hochberg <[EMA

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Tim Hochberg
Brian Granger wrote: > When I set seterr(all='warn') I see the following: > > In [1]: import numpy > /usr/common/homes/g/granger/usr/local/lib/python/numpy/lib/ufunclike.py:46: > RuntimeWarning: invalid value encountered in log > _log2 = umath.log(2) > /usr/common/homes/g/granger/usr/local/lib/py

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
I have been doing these recent tests with 1.0rc3. I am building from trunk right now and we will see how that goes. Thanks for your help. Brian On 10/20/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: > Brian Granger wrote: > > Also, when I use seterr(all='ignore') the the tests fail: > > > > =

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Tim Hochberg
Brian Granger wrote: > Also, when I use seterr(all='ignore') the the tests fail: > > == > FAIL: Ticket #112 > -- > Traceback (most recent call last): > File > "

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
When I set seterr(all='warn') I see the following: In [1]: import numpy /usr/common/homes/g/granger/usr/local/lib/python/numpy/lib/ufunclike.py:46: RuntimeWarning: invalid value encountered in log _log2 = umath.log(2) /usr/common/homes/g/granger/usr/local/lib/python/numpy/lib/scimath.py:19: Runt

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
Also, when I use seterr(all='ignore') the the tests fail: == FAIL: Ticket #112 -- Traceback (most recent call last): File "/usr/common/homes/g/granger/usr/loca

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
Here is the traceback that I got: In [1]: import numpy --- exceptions.FloatingPointErrorTraceback (most recent call last) /u2/granger/ /usr/common/homes/g/granger/usr/local/lib/python/numpy/__init__.p

Re: [Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Tim Hochberg
Brian Granger wrote: > Hi, > > i am running numpy on aix compiling with xlc. Revision 1.0rc2 works > fine and passes all tests. But 1.0rc3 and more recent give the > following on import: > > Warning: invalid value encountered in multiply > Warning: invalid value encountered in multiply > Warning:

[Numpy-discussion] Problem introduced after 1.0rc2 on AIX with xlc

2006-10-20 Thread Brian Granger
Hi, i am running numpy on aix compiling with xlc. Revision 1.0rc2 works fine and passes all tests. But 1.0rc3 and more recent give the following on import: Warning: invalid value encountered in multiply Warning: invalid value encountered in multiply Warning: invalid value encountered in multipl

Re: [Numpy-discussion] Model and experiment fitting.

2006-10-20 Thread A. M. Archibald
On 20/10/06, Sebastian Żurek <[EMAIL PROTECTED]> wrote: > Is there something like that in any numerical python modules (numpy, > pylab) I could use? In scipy there are some very convenient spline fitting tools which will allow you to fit a nice smooth spline through the simulation data points (o

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Travis Oliphant
Sebastien Bardeau wrote: >>One possible solution (there can be more) is using ndarray: >> >>In [47]: a=numpy.array([1,2,3], dtype="i4") >>In [48]: n=1# the position that you want to share >>In [49]: b=numpy.ndarray(buffer=a[n:n+1], shape=(), dtype="i4") >> >> >> >Ok thanks. Actually that

Re: [Numpy-discussion] Model and experiment fitting.

2006-10-20 Thread Robert Kern
Sebastian Żurek wrote: > Hi! > > This is probably a silly question but I'm getting confused with a > certain problem: a comparison between experimental data points (2D > points set) and a model (2D points set - no analytical form). > > The physical model produces (by a sophisticated simulations

[Numpy-discussion] Model and experiment fitting.

2006-10-20 Thread Sebastian Żurek
Hi! This is probably a silly question but I'm getting confused with a certain problem: a comparison between experimental data points (2D points set) and a model (2D points set - no analytical form). The physical model produces (by a sophisticated simulations done by an external program) some 2

Re: [Numpy-discussion] slicing suggestion

2006-10-20 Thread Keith Goodman
On 10/20/06, JJ <[EMAIL PROTECTED]> wrote: > My suggestion is to > create a new attribute, such as .AR, so that the > following could be used: M[K.AR,:] It would be even better if M[K,:] worked. Would such a patch be accepted? (Not that I know how to make it.)

[Numpy-discussion] slicing suggestion

2006-10-20 Thread JJ
Hello. I have a suggestion that might make slicing using matrices more user-friendly. I often have a matrix of row or column numbers that I wish to use as a slice. If K was a matrix of row numbers (nx1) and M was a nxm matrix, then I would use ans = M[K.A.ravel(),:] to obtain the matrix I want.

Re: [Numpy-discussion] histogram complete makeover

2006-10-20 Thread David Huard
Thanks for the comments, Here is the code for the new histogram, tests included. I'll wait for comments or suggestions before submitting a patch (numpy / scipy) ?CheersDavid 2006/10/18, Tim Hochberg <[EMAIL PROTECTED]>: My $0.02:If histogram is going to get a makeover, particularly one that makes i

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Tim Hochberg
Sebastien Bardeau wrote: > Ooops sorry there was two mistakes with the 'hasslice' flag. This seems > now to work for me. > > [SNIP code] That looks overly complicated. I believe that this (minimally tested in a slightly different setting) or some variation should work: return self[...,newaxi

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Sebastien Bardeau
Ooops sorry there was two mistakes with the 'hasslice' flag. This seems now to work for me. def __getitem__(self,index): # Index may be either an int or a tuple # Index length: if type(index) == int: # A single element through first dimension ilen = 1 index = (ind

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Tim Hochberg
Francesc Altet wrote: > A Divendres 20 Octubre 2006 11:42, Sebastien Bardeau va escriure: > [snip] > >> I can understand that numpy.scalars do not provide inplace operations >> (like Python standard scalars, they are immutable), so I'd like to use >> >> 0-d Numpy.ndarrays. But: >> >>> d = numpy

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Sebastien Bardeau
> One possible solution (there can be more) is using ndarray: > > In [47]: a=numpy.array([1,2,3], dtype="i4") > In [48]: n=1# the position that you want to share > In [49]: b=numpy.ndarray(buffer=a[n:n+1], shape=(), dtype="i4") > Ok thanks. Actually that was also the solution I found. But t

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Stefan van der Walt
On Fri, Oct 20, 2006 at 11:42:26AM +0200, Sebastien Bardeau wrote: > >>> a = numpy.array((1,2,3)) > >>> b = a[:2] Here you index by a slice. > >>> c = a[2] Whereas here you index by a scalar. So you want to do b = a[[2]] b += 1 or in the general case b = a[slice(2,3)] b += 1 Regards Stéf

[Numpy-discussion] Helper function to "unroll" a array

2006-10-20 Thread Gael Varoquaux
Hi, There is an operation I do a lot, I would call it "unrolling" a array. The best way to describe it is probably to give the code: def unroll(M): """ Flattens the array M and returns a 2D array with the first columns being the indices of M, and the last column the flatten M. ""

Re: [Numpy-discussion] Can' compile numpy 1.02rc3 on OSX 10.3.9

2006-10-20 Thread Markus Rosenstihl
Am 20.10.2006 um 02:53 schrieb Jay Parlar: >> Hi! >> I try to compile numpy rc3 on Panther and get following errors. >> (I start build with "python2.3 setup.py build" to be sure to use the >> python shipped with OS X. I din't manage to compile Python2.5 either >> yet with similar errors) >> Does

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Francesc Altet
A Divendres 20 Octubre 2006 11:42, Sebastien Bardeau va escriure: [snip] > I can understand that numpy.scalars do not provide inplace operations > (like Python standard scalars, they are immutable), so I'd like to use > > 0-d Numpy.ndarrays. But: > >>> d = numpy.array(a[2],copy=False) > >>> d +=

[Numpy-discussion] いつでもどこで もイカす出会い天国

2006-10-20 Thread EAGF
中だし体験記!携帯番号ゲットで中だし・・・最高です! http://carmastorra.com/ika/ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM We

[Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Sebastien Bardeau
Hi! I am confused with Numpy behavior with its scalar or 0-d arrays objects: >>> numpy.__version__ '1.0rc2' >>> a = numpy.array((1,2,3)) >>> b = a[:2] >>> b += 1 >>> b array([2, 3]) >>> a array([2, 3, 3]) >>> type(b) To this point all is ok for me: subarrays share (by default) memory wit

Re: [Numpy-discussion] adding an attribute to an nd-array

2006-10-20 Thread Stefan van der Walt
On Thu, Oct 19, 2006 at 09:03:57PM -0400, Pierre GM wrote: > Indeed. That's basically why you have to edit your __array_finalize__ . > > class InfoArray(N.ndarray): > def __new__(info_arr_cls,arr,info={}): > info_arr_cls._info = info > return N.array(arr).view(info_arr_cls) >

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-20 Thread Travis Oliphant
A. M. Archibald wrote: >On 18/10/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > > >>If there are any cases satisfying these rules where a copy does not have >>to occur then let me know. >> >> > >For example, zeros((4,4))[:,1].reshape((2,2)) need not be copied. > >I filed a bug in trac an

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-20 Thread A. M. Archibald
On 18/10/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > If there are any cases satisfying these rules where a copy does not have > to occur then let me know. For example, zeros((4,4))[:,1].reshape((2,2)) need not be copied. I filed a bug in trac and supplied a patch to multiarray.c that avoids