[Numpy-discussion] Use of numarray from numpy package

2006-08-31 Thread LANDRIU David SAp
Hello, I learned you answered me, but I did not get your message : can you send it to me again ? Thanks , David Landriu David Landriu DAPNIA/SAp CEA SACLAY (France) Phone : (

Re: [Numpy-discussion] Use of numarray from numpy package

2006-08-31 Thread Steve Lianoglou
On Aug 31, 2006, at 6:19 AM, LANDRIU David SAp wrote: >I learned you answered me, but I did not get > your message : can you send it to me again ? Does this help? http://sourceforge.net/mailarchive/forum.php? thread_id=30384097&forum_id=4890 -steve ---

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Travis Oliphant
Fernando Perez wrote: > On 8/30/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > >> The current behaviour makes sense, but is maybe not consistent: >> >> N.array([],dtype=object).size == 1 >> N.array([[],[]],dtype=object).size == 2 >> > > Yes, including one more term in this check: >

Re: [Numpy-discussion] Unwanted upcast from uint64 to float64

2006-08-31 Thread Travis Oliphant
Torgil Svensson wrote: > I'm using windows datetimes (100nano-seconds since 0001,1,1) as time > in a numpy array and was hit by this behaviour. > > numpy.__version__ > '1.0b4' > a=numpy.array([63292539433000L],numpy.uint64) t=a[0] t > 632925

[Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
In version 0.9.6 one used to be able to do this: In [4]: numpy.__version__ Out[4]: '0.9.6' In [6]: numpy.array([numpy.array([4,5,6]), numpy.array([1,2,3])], dtype=object).shape Out[6]: (2, 3) In beta 1 numpy.PyObject no longer exists. I was trying to get the same behavior with dtype=object bu

[Numpy-discussion] BLAS not found in numpy 1.0b4

2006-08-31 Thread Jonathan Taylor
When trying to install 1.0b4 I had trouble getting it to detect my installed atlas. This was because the shipped site.cfg had; [atlas] library_dirs = /usr/lib/atlas/3dnow/ atlas_libs = lapack, blas but I had to change 3dnow to sse2 due to my current state of pentiumness. In any case it should p

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-31 Thread Darren Dale
On Tuesday 29 August 2006 19:24, Fernando Perez wrote: > On 8/29/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Classes start for me next Tuesday, and I'm teaching a class for which I > > will be using NumPy / SciPy extensively. I need to have a release of > > these two (and ho

[Numpy-discussion] numpy/f2py module import segfault on HP-UX11.11

2006-08-31 Thread Christophe-Blondeau
Hi everybody I've succesfully built Numpy-1.0b4 on HP-UX 11.11 with all tests passed succesfully (gcc 4.1.1) on Python 2.4.2 I try to import 2 basic Fortran modules compiled with numpy/f2py (fcompiler = gfortran (gcc 4.1.1)) The modules hello1 and hello2 are almost identical: C File hello1.

Re: [Numpy-discussion] Unwanted upcast from uint64 to float64

2006-08-31 Thread Torgil Svensson
> Yes, because you are adding a signed scalar to an unsigned scalar and a > float64 is the only thing that can handle it > > t+numpy.uint64(1) Thanks, this make sense. This is a good thing to have back in the head. //Torgil On 8/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Torgil Svensso

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Fernando Perez
On 8/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > What about > > N.array(3).size > > N.array([3]).size > > N.array([3,3]).size > > Essentially, the [] is being treated as an object when you explicitly > ask for an object array in exactly the same way as 3 is being treated as > a number in t

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Charles R Harris
On 8/31/06, Fernando Perez <[EMAIL PROTECTED]> wrote: On 8/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:> What about>> N.array(3).size>> N.array([3]).size>> N.array ([3,3]).size>> Essentially, the [] is being treated as an object when you explicitly> ask for an object array in exactly the same

[Numpy-discussion] numpy and dtype

2006-08-31 Thread humufr
Hi, sorry to bother you with probably plenty of stupid question but I would like to clarify my mind with dtype. I have a problem to view a recarray, I'm not sure but I suspect a bug or at least a problem I have an array with some data, the array is very big but I have no prob

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Tom Denniston <[EMAIL PROTECTED]> wrote: In version 0.9.6 one used to be able to do this:In [4]: numpy.__version__Out[4]: '0.9.6'In [6]: numpy.array([numpy.array([4,5,6]), numpy.array([1,2,3])],dtype=object).shapeOut[6]: (2, 3) In beta 1 numpy.PyObject no longer exists.  I was trying to

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
For this simple example yes, but if one of the nice things about the array constructors is that they know that lists, tuple and arrays are just sequences and any combination of them is valid numpy input.  So for instance a list of tuples yields a 2d array.  A list of tuples of 1d arrays yields a 3d

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Tom Denniston <[EMAIL PROTECTED]> wrote: For this simple example yes, but if one of the nice things about the array constructors is that they know that lists, tuple and arrays are just sequences and any combination of them is valid numpy input.  So for instance a list of tuples yields a

Re: [Numpy-discussion] BLAS not found in numpy 1.0b4

2006-08-31 Thread Christopher Barker
Jonathan Taylor wrote: > When trying to install 1.0b4 I had trouble getting it to detect my > installed atlas. This was because the shipped site.cfg had; > > [atlas] > library_dirs = /usr/lib/atlas/3dnow/ > atlas_libs = lapack, blas > > but I had to change 3dnow to sse2 due to my current state o

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Christopher Barker
Fernando Perez wrote: > In [8]: N.array(3).shape > Out[8]: () > In [11]: N.array([]).shape > Out[11]: (0,) > I guess my only remaining question is: what is the difference between > outputs #8 and #11 above? Is an empty shape tuple == array scalar, > while a (0,) shape indicates a one-dimensional

Re: [Numpy-discussion] BLAS not found in numpy 1.0b4

2006-08-31 Thread Charles R Harris
On 8/31/06, Christopher Barker <[EMAIL PROTECTED]> wrote: Jonathan Taylor wrote:> When trying to install 1.0b4 I had trouble getting it to detect my> installed atlas.  This was because the shipped site.cfg had;>> [atlas]> library_dirs = /usr/lib/atlas/3dnow/ > atlas_libs = lapack, blas>> but I had

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Tim Hochberg
Christopher Barker wrote: > Fernando Perez wrote: > >> In [8]: N.array(3).shape >> Out[8]: () >> > > >> In [11]: N.array([]).shape >> Out[11]: (0,) >> > > >> I guess my only remaining question is: what is the difference between >> outputs #8 and #11 above? Is an empty shape tupl

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
But i have hetergenious arrays that have numbers and strings and NoneType, etc. Take for instance: In [11]: numpy.array([numpy.array([1,'A', None]), numpy.array([2,2,'Some string'])], dtype=object) Out[11]: array([[1, A, None], [2, 2, Some string]], dtype=object) In [12]: numpy.array([num

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Charles R Harris
On 8/31/06, Christopher Barker <[EMAIL PROTECTED]> wrote: Fernando Perez wrote:> In [8]: N.array(3).shape> Out[8]: ()> In [11]: N.array([]).shape> Out[11]: (0,)> I guess my only remaining question is: what is the difference between> outputs #8 and #11 above?  Is an empty shape tuple == array scalar

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Tom Denniston <[EMAIL PROTECTED]> wrote: But i have hetergenious arrays that have numbers and strings and NoneType, etc.Take for instance:In [11]: numpy.array([numpy.array([1,'A', None]),numpy.array([2,2,'Some string'])], dtype=object)Out[11]: array([[1, A, None],   [2, 2, Some stri

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 8/31/06, Tom Denniston <[EMAIL PROTECTED] > wrote: But i have hetergenious arrays that have numbers and strings and NoneType, etc.Take for instance:In [11]: numpy.array([numpy.array([1,'A', None]),numpy.array([2,2,'Some string'])], dtype=o

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
Yes one can take a toy example and hack it to work but I don't necessarily have control over the input as to whether it is a list of object arrays, list of 1d heterogenous arrays, etc.  Before I didn't need to worry about the input because numpy understood that a list of 1d arrays is a 2d piece of

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
wrote the last email before reading your a = array([1,'A', None]) comment.  I definately agree with you on that. On 8/31/06, Tom Denniston <[EMAIL PROTECTED]> wrote: Yes one can take a toy example and hack it to work but I don't necessarily have control over the input as to whether it is a list o

[Numpy-discussion] Strange exp

2006-08-31 Thread Angelo Secchi
Hi, I have the following script import fileinput import string from math import * from scipy import * from rpy import * import Numeric import shelve import sys def dpolya1(n,N,b,a): a=float(a) b=float(b) L=784 probs=((special.gammaln(N+1)+special.gammaln(L*(a/b))+special.gammal

Re: [Numpy-discussion] fromiter shape argument -- was Re: For loop tips

2006-08-31 Thread Torgil Svensson
> Yes. fromiter(iterable, dtype, count) works. Oh. Thanks. I probably had too old documentation to see this (15 June). If it's not updated since I'll give Travis a rest about this, at least until 1.0 is released :) > Regardless, L is only iterated over once. How can this be true? If no size is

Re: [Numpy-discussion] For loop tips

2006-08-31 Thread Torgil Svensson
def list2index(L): uL=sorted(set(L)) idx=dict((y,x) for x,y in enumerate(uL)) return uL,asmatrix(fromiter((idx[x] for x in L),dtype=int,count=len(L))) adding the count will save you a little more time, and temporary memory [see related thread]. //Torgil On 8/29/06, Keith Goodman <[EM

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
I submitted a ticket for this.On 8/31/06, Tom Denniston <[EMAIL PROTECTED]> wrote: wrote the last email before reading your a = array([1,'A', None]) comment.  I definately agree with you on that. On 8/31/06, Tom Denniston <[EMAIL PROTECTED] > wrote: Yes one can take a toy example and hack it to

Re: [Numpy-discussion] Strange exp

2006-08-31 Thread Robert Kern
Angelo Secchi wrote: > Hi, > I have the following script > > import fileinput > import string > from math import * > from scipy import * > from rpy import * > import Numeric > import shelve > import sys > > def dpolya1(n,N,b,a): > a=float(a) > b=float(b) > L=784 > > probs=((spec

Re: [Numpy-discussion] fromiter shape argument -- was Re: For loop tips

2006-08-31 Thread Tim Hochberg
Torgil Svensson wrote: >> Yes. fromiter(iterable, dtype, count) works. >> > > Oh. Thanks. I probably had too old documentation to see this (15 > June). If it's not updated since I'll give Travis a rest about this, > at least until 1.0 is released :) > Actually I just knew 'cause I wrote it.

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Christopher Barker
Tim Hochberg wrote: >> That's what I'd expect, but what if you start with a (0,) array: >> >>> a = N.array([]).sum(); a.shape; a.size; a >> () >> 1 >> 0 >> >> where did that zero come from? >> > More or less from: > > >>> numpy.add.identity > 0 I'm not totally sure, but I think I'd r

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Christopher Barker
Tom Denniston wrote: > So my question is what is the _advantage_ of the new semantics? what if the list don't have the same length, and therefor can not be made into an array, now you get a weird result: >>>N.array([N.array([1,'A',None],dtype=object),N.array([2,2,'Somestring',5],dtype=object)]

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Tom Denniston
I would think one would want to throw an error when the data has inconsistent dimensions.  This is what numpy does for other dtypes:     In [10]: numpy.array(([1,2,3], [4,5,6]))Out[10]:array([[1, 2, 3],   [4, 5, 6]]) In [11]: numpy.array(([1,3], [4,5,6]))

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Christopher Barker
Tom Denniston wrote: > I would think one would want to throw an error when the data has > inconsistent dimensions. But it doesn't have inconsistent dimensions - they are perfectly consistent with a (2,) array of objects. How is the code to know what you intended? With numeric types, it is unamb

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Christopher Barker <[EMAIL PROTECTED]> wrote: Tom Denniston wrote:> I would think one would want to throw an error when the data has> inconsistent dimensions.But it doesn't have inconsistent dimensions - they are perfectlyconsistent with a (2,) array of objects. How is the code to know

Re: [Numpy-discussion] amd64 support

2006-08-31 Thread David M. Cooke
On Aug 30, 2006, at 11:53 , Keith Goodman wrote: > I plan to build an amd64 box and run debian etch. Are there any big, > 64-bit, show-stopping problems in numpy? Any minor annoyances? Shouldn't be; I regularly build and test it on an amd64 box running Debian unstable, and I know several others