[Numpy-discussion] numpy where and dtype in 1.9

2015-07-29 Thread Nathan Jensen
Hi, The numpy.where() function was rewritten in numpy 1.9 to speed it up. I traced it to this changeset. https://github.com/numpy/numpy/commit/593e3c30c24f0c61a271dc883c614724d7a57e1e The weird thing is the 1.9 behavior changed the resulting dtype in some situations when using scalar values as

Re: [Numpy-discussion] numpy where and dtype in 1.9

2015-07-29 Thread Benjamin Root
What a coincidence! A very related bug just got re-opened today at my behest: https://github.com/numpy/numpy/issues/5095 Not the same, but I wouldn't be surprised if it stems from the same sources. The short of it... np.where(x, 0, x) where x is a masked array, will return a masked array in

[Numpy-discussion] strange casting rules

2015-07-29 Thread Neal Becker
np.uint64(-1)+0 Out[36]: 1.8446744073709552e+19 I often work on signal processing requiring bit-exact integral arithmetic. Promoting to float is not helpful - I don't understand the logic of the above example. ___ NumPy-Discussion mailing list

[Numpy-discussion] stats functions with weight support

2015-07-29 Thread Neal Becker
The histogram function supports a weights option, but most others (e.g., percentile) do not. For my problem, I have a trace of the amounts of time (floating point) that my machine under test is in each of N states. I'd like to produce histograms, kde, maybe nice pics with seaborn. I can use

Re: [Numpy-discussion] strange casting rules

2015-07-29 Thread Robert Kern
On Wed, Jul 29, 2015 at 1:07 PM, Neal Becker ndbeck...@gmail.com wrote: np.uint64(-1)+0 Out[36]: 1.8446744073709552e+19 I often work on signal processing requiring bit-exact integral arithmetic. Promoting to float is not helpful - I don't understand the logic of the above example. See this