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