Dag Sverre Seljebotn wrote:
> I haven't heard of anything, but here's what I'd do:
> - Use np.int64
> - Multiply all inputs to my code with 10^6
> - Divide all output from my code with 10^6
> - If you need to debug-print and array, simply define something like
>
> FIXED_POINT_FACTOR = 10*
Travis E. Oliphant wrote:
> Thomas J. Duck wrote:
>
>> Determining the minimum value of an array that contains NaN produces
>> a surprising result:
>>
>> >>> x = numpy.array([0,1,2,numpy.nan,4,5,6])
>> >>> x.min()
>> 4.0
>>
>> I expected 0.0. Is this the intended behaviour or a bug? I am u
Basically, what you want to do is a histogram. Numpy has that
functionality built in. However: the version built in to numpy is about
as suboptimal as yours. The problem is the unnecessary sorting of the data.
In principle, a histogram does not need any sorting, so it could be done
in strictly O(N
The following snippet demonstrates a problem in the interaction of
numarray 1.5.2 with numpy 1.0.1 (and older versions):
---
#!/usr/bin/env python
import numarray, numpy
na = numarray.array(0.)
np = numpy.array(0.)
na[...] = np
---
the last linec causes the erro