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

2015-07-30 Thread Nathan Jensen
gt; np.where(x, 0, x) > > where x is a masked array, will return a masked array in 1.8.2 and > earlier, but will return a regular numpy array in 1.9 and above (drops the > mask). > That bug took a long time for me to track down! > > Ben Root > > On Wed, Jul 29, 2015 at 5:16 P

[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 t

[Numpy-discussion] slow import of numpy modules

2008-07-02 Thread Nathan Jensen
Hi, I was wondering if there was any way to speed up the global import of numpy modules. For a simple import numpy, it takes ~250 ms. In comparison, importing Numeric is only taking 40 ms. It appears that even if you only import a numpy submodule, it loads all the libraries, resulting in the pa