Hi,
On Sat, Oct 15, 2011 at 12:20 PM, Matthew Brett wrote:
> Hi,
>
> On Tue, Oct 11, 2011 at 7:32 PM, Benjamin Root wrote:
>> On Tue, Oct 11, 2011 at 2:06 PM, Derek Homeier
>> wrote:
>>>
>>> On 11 Oct 2011, at 20:06, Matthew Brett wrote:
>>>
>>> > Have I missed a fast way of doing nice float to
Hi,
On Tue, Oct 11, 2011 at 7:32 PM, Benjamin Root wrote:
> On Tue, Oct 11, 2011 at 2:06 PM, Derek Homeier
> wrote:
>>
>> On 11 Oct 2011, at 20:06, Matthew Brett wrote:
>>
>> > Have I missed a fast way of doing nice float to integer conversion?
>> >
>> > By nice I mean, rounding to the nearest i
On Tue, Oct 11, 2011 at 2:06 PM, Derek Homeier <
de...@astro.physik.uni-goettingen.de> wrote:
> On 11 Oct 2011, at 20:06, Matthew Brett wrote:
>
> > Have I missed a fast way of doing nice float to integer conversion?
> >
> > By nice I mean, rounding to the nearest integer, converting NaN to 0,
> >
Hi,
On Tue, Oct 11, 2011 at 5:30 PM, Derek Homeier
wrote:
> On 11.10.2011, at 9:18PM, josef.p...@gmail.com wrote:
>>>
>>> In [42]: c = np.zeros(4, np.int16)
>>> In [43]: d = np.zeros(4, np.int32)
>>> In [44]: np.around([1.6,np.nan,np.inf,-np.inf], out=c)
>>> Out[44]: array([2, 0, 0, 0], dtype=int
On 11.10.2011, at 9:18PM, josef.p...@gmail.com wrote:
>>
>> In [42]: c = np.zeros(4, np.int16)
>> In [43]: d = np.zeros(4, np.int32)
>> In [44]: np.around([1.6,np.nan,np.inf,-np.inf], out=c)
>> Out[44]: array([2, 0, 0, 0], dtype=int16)
>>
>> In [45]: np.around([1.6,np.nan,np.inf,-np.inf], out=d)
Hi,
On Tue, Oct 11, 2011 at 3:06 PM, Derek Homeier
wrote:
> On 11 Oct 2011, at 20:06, Matthew Brett wrote:
>
>> Have I missed a fast way of doing nice float to integer conversion?
>>
>> By nice I mean, rounding to the nearest integer, converting NaN to 0,
>> inf, -inf to the max and min of the in
On Tue, Oct 11, 2011 at 3:06 PM, Derek Homeier
wrote:
> On 11 Oct 2011, at 20:06, Matthew Brett wrote:
>
>> Have I missed a fast way of doing nice float to integer conversion?
>>
>> By nice I mean, rounding to the nearest integer, converting NaN to 0,
>> inf, -inf to the max and min of the integer
On 11 Oct 2011, at 20:06, Matthew Brett wrote:
> Have I missed a fast way of doing nice float to integer conversion?
>
> By nice I mean, rounding to the nearest integer, converting NaN to 0,
> inf, -inf to the max and min of the integer range? The astype method
> and cast functions don't do what
Hi,
Have I missed a fast way of doing nice float to integer conversion?
By nice I mean, rounding to the nearest integer, converting NaN to 0,
inf, -inf to the max and min of the integer range? The astype method
and cast functions don't do what I need here:
In [40]: np.array([1.6, np.nan, np.inf