Re: [Numpy-discussion] Can PyArray_CastTo be used to "subcast" an array of float to int

2007-01-15 Thread David Cournapeau
David Cournapeau wrote: > Hi, > > I would like to convert a double array to an *existing* array of > int32 using the C numpy API. I tried using PyArray_CastTo, but this > gives me an array full of zeros instead of converting the items to int. > I am doing something like the following to conv

[Numpy-discussion] Can PyArray_CastTo be used to "subcast" an array of float to int

2007-01-15 Thread David Cournapeau
Hi, I would like to convert a double array to an *existing* array of int32 using the C numpy API. I tried using PyArray_CastTo, but this gives me an array full of zeros instead of converting the items to int. I am doing something like the following to convert a PyArrayObject in_o of double

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread David Cournapeau
David Cournapeau wrote: > Charles R Harris wrote: >> >> On 1/15/07, *A. M. Archibald* <[EMAIL PROTECTED] >> > wrote: >> >> On 15/01/07, David Cournapeau <[EMAIL PROTECTED] >> > wrote: >> > Hi, >> > >> > I am trying to add

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread David Cournapeau
Charles R Harris wrote: > > > On 1/15/07, *A. M. Archibald* <[EMAIL PROTECTED] > > wrote: > > On 15/01/07, David Cournapeau <[EMAIL PROTECTED] > > wrote: > > Hi, > > > > I am trying to add support for out argument to one C

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread A. M. Archibald
On 15/01/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > Since the point of output arguments is to avoid allocating new > > storage, > > > If we take that seriously, then an error should be raised on a shape, or > type mismatch. In fact: In [10]: a = zeros(3) In [11]: b = zeros(4,dtype=uint

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread Charles R Harris
On 1/15/07, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 15/01/07, David Cournapeau <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to add support for out argument to one C function using > numpy API (still the clip function). I was wondering about the expected > behaviour when out does no

Re: [Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread A. M. Archibald
On 15/01/07, David Cournapeau <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to add support for out argument to one C function using > numpy API (still the clip function). I was wondering about the expected > behaviour when out does not have the "expected" type. > For example, using again

[Numpy-discussion] Should non ufunc numpy functions behave like ufunc regarding casting to output argument ?

2007-01-15 Thread David Cournapeau
Hi, I am trying to add support for out argument to one C function using numpy API (still the clip function). I was wondering about the expected behaviour when out does not have the "expected" type. For example, using again the clip function (but the question is not specific to this func

Re: [Numpy-discussion] Come to PyCon if you can

2007-01-15 Thread Fernando Perez
On 1/15/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > Greetings, > > This is a little plug for coming to PyCon Feb 22-25. I am going to be > there from Thursday night (Feb. 22) until Saturday evening (Feb. 25), > and would like to meet with anyone interested to discuss some of the > issues su

[Numpy-discussion] Come to PyCon if you can

2007-01-15 Thread Travis Oliphant
Greetings, This is a little plug for coming to PyCon Feb 22-25. I am going to be there from Thursday night (Feb. 22) until Saturday evening (Feb. 25), and would like to meet with anyone interested to discuss some of the issues surrounding NumPy/SciPy and the PEPs we are working on for Python

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-15 Thread Erin Sheldon
On 1/13/07, Robert Kern <[EMAIL PROTECTED]> wrote: > > Import of pylab still fails. The failure is now different. Using gdb I get > > --snip-- > > Reading symbols for shared libraries . done > > Reading symbols for shared libraries .. done > > 20:48:11: Debug: ../src/common/object.cpp(224): asser

Re: [Numpy-discussion] rounding all element of an array with more than 1d

2007-01-15 Thread Giorgio Luciano
Yes it worked, sorry for bothering. the problem was theI used round with no underscore.. and so I made confusion with the two command Thank a lot !! > > ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/li

Re: [Numpy-discussion] rounding all element of an array with more than 1d

2007-01-15 Thread Nils Wagner
Giorgio Luciano wrote: > I've posted also to scipy group but with no luck. > At first I thought it was an easy task but... > I've to round the numbers inside of a 2d array but nothing seems to > work. the only message I've found in the archive is an old function > custom made for doing that.. wou

[Numpy-discussion] rounding all element of an array with more than 1d

2007-01-15 Thread Giorgio Luciano
I've posted also to scipy group but with no luck. At first I thought it was an easy task but... I've to round the numbers inside of a 2d array but nothing seems to work. the only message I've found in the archive is an old function custom made for doing that.. wouldn't be useful to have it also i