Hi,
On Sat, Oct 15, 2011 at 12:20 PM, Matthew Brett matthew.br...@gmail.com wrote:
Hi,
On Tue, Oct 11, 2011 at 7:32 PM, Benjamin Root ben.r...@ou.edu wrote:
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
Hi,
On Tue, Oct 11, 2011 at 7:32 PM, Benjamin Root ben.r...@ou.edu wrote:
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
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,
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 I
On Tue, Oct 11, 2011 at 3: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,
inf, -inf to the
Hi,
On Tue, Oct 11, 2011 at 3: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,
inf, -inf
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)
Out[45]:
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,
inf, -inf