[Numpy-discussion] ANN: numpydoc 0.6.0 released

2016-02-13 Thread Ralf Gommers
Hi all, I'm pleased to announce the release of numpydoc 0.6.0. The main new feature is support for the Yields section in numpy-style docstrings. This is described in https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt Numpydoc can be installed from PyPi:

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-13 Thread R Schumacher
Have you all conferred with C Gohlke on his Windows build bot? I've never seen a description of his recipes. The MKL linking aside, his binaries always seem to work flawlessly. - Ray At 11:16 PM 2/12/2016, you wrote: AFAIK the vcvarsall.bat error occurs when your MSVC directories aren't

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-13 Thread G Young
I've actually had test failures on occasion (i.e. when I run "numpy.test()") with his builds but overall, they are quite good. Speaking of MKL, for anyone who uses conda, does anyone know if it is possible to link the "mkl" package to the numpy source? My first guess is no since the description

[Numpy-discussion] Modulus (remainder) function corner cases

2016-02-13 Thread Charles R Harris
Hi All, I'm curious as to what folks think about some choices in the compution of the remainder function. As an example where different choices can be made In [2]: -1e-64 % 1. Out[2]: 1.0 In [3]: float64(-1e-64) % 1. Out[3]: 0.99989 The first is Python, the second is in my branch.

Re: [Numpy-discussion] Modulus (remainder) function corner cases

2016-02-13 Thread Charles R Harris
On Sat, Feb 13, 2016 at 9:31 AM, Charles R Harris wrote: > Hi All, > > I'm curious as to what folks think about some choices in the compution of > the remainder function. As an example where different choices can be made > > In [2]: -1e-64 % 1. > Out[2]: 1.0 > > In

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Allan Haldane
I've had a pretty similar idea for a new indexing function 'split_classes' which would help in your case, which essentially does def split_classes(c, v): return [v[c == u] for u in unique(c)] Your example could be coded as >>> [sum(c) for c in split_classes(label, data)]

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-13 Thread Jonathan Helmus
On 2/12/16 10:23 PM, Matthew Brett wrote: On Fri, Feb 12, 2016 at 8:18 PM, R Schumacher wrote: At 03:45 PM 2/12/2016, you wrote: PS C:\tmp> c:\Python35\python -m venv np-testing PS C:\tmp> .\np-testing\Scripts\Activate.ps1 (np-testing) PS C:\tmp> pip install -f

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Allan Haldane
Sorry, to reply to myself here, but looking at it with fresh eyes maybe the performance of the naive version isn't too bad. Here's a comparison of the naive vs a better implementation: def split_classes_naive(c, v): return [v[c == u] for u in unique(c)] def split_classes(c, v): perm =

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Nathaniel Smith
I believe this is basically a groupby, which is one of pandas's core competencies... even if numpy were to add some utilities for this kind of thing, then I doubt we'd do as well as them, so you might check whether pandas works for you first :-) On Feb 12, 2016 6:40 AM, "Sérgio"

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread josef.pktd
On Sat, Feb 13, 2016 at 1:01 PM, Allan Haldane wrote: > Sorry, to reply to myself here, but looking at it with fresh eyes maybe > the performance of the naive version isn't too bad. Here's a comparison of > the naive vs a better implementation: > > def

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Jeff Reback
In [10]: pd.options.display.max_rows=10 In [13]: np.random.seed(1234) In [14]: c = np.random.randint(0,32,size=10) In [15]: v = np.arange(10) In [16]: df = DataFrame({'v' : v, 'c' : c}) In [17]: df Out[17]: c v 0 15 0 1 19 1 2 6 2 3 21

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Jeff Reback
These operations get slower as the number of groups increase, but with a faster function (e.g. the standard ones which are cythonized), the constant on the increase is pretty low. In [23]: c = np.random.randint(0,1,size=10) In [24]: df = DataFrame({'v' : v, 'c' : c}) In [25]: %timeit

Re: [Numpy-discussion] Subclassing ma.masked_array, code broken after version 1.9

2016-02-13 Thread Jonathan Helmus
On 2/12/16 6:06 PM, Gutenkunst, Ryan N - (rgutenk) wrote: Hello all, In 2009 I developed an application that uses a subclass of masked arrays as a central data object. My subclass Spectrum possesses additional attributes along with many custom methods. It was very convenient to be able to

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread josef.pktd
On Sat, Feb 13, 2016 at 1:42 PM, Jeff Reback wrote: > These operations get slower as the number of groups increase, but with a > faster function (e.g. the standard ones which are cythonized), the > constant on > the increase is pretty low. > > In [23]: c =

Re: [Numpy-discussion] ANN: numpydoc 0.6.0 released

2016-02-13 Thread josef.pktd
On Sat, Feb 13, 2016 at 10:03 AM, Ralf Gommers wrote: > Hi all, > > I'm pleased to announce the release of numpydoc 0.6.0. The main new > feature is support for the Yields section in numpy-style docstrings. This > is described in >

[Numpy-discussion] ANN: pandas v0.18.0rc1 - RELEASE CANDIDATE

2016-02-13 Thread Jeff Reback
Hi, I'm pleased to announce the availability of the first release candidate of Pandas 0.18.0. Please try this RC and report any issues here: Pandas Issues We will be releasing officially in 1-2 weeks or so. **RELEASE CANDIDATE 1** This is a major

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-13 Thread josef.pktd
On Sat, Feb 13, 2016 at 9:43 PM, wrote: > > > On Sat, Feb 13, 2016 at 8:57 PM, Antony Lee > wrote: > >> Compare (on Python3 -- for Python2, read "xrange" instead of "range"): >> >> In [2]: %timeit np.array(range(100), np.int64) >> 10 loops,

Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-13 Thread Allan Haldane
Impressive! Possibly there's still a case for including a 'groupby' function in numpy itself since it's a generally useful operation, but I do see less of a need given the nice pandas functionality. At least, next time someone asks a stackoverflow question like the ones below someone should

[Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-13 Thread Antony Lee
Compare (on Python3 -- for Python2, read "xrange" instead of "range"): In [2]: %timeit np.array(range(100), np.int64) 10 loops, best of 3: 156 ms per loop In [3]: %timeit np.arange(100, dtype=np.int64) 1000 loops, best of 3: 853 µs per loop Note that while iterating over a range is not

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-13 Thread josef.pktd
On Sat, Feb 13, 2016 at 8:57 PM, Antony Lee wrote: > Compare (on Python3 -- for Python2, read "xrange" instead of "range"): > > In [2]: %timeit np.array(range(100), np.int64) > 10 loops, best of 3: 156 ms per loop > > In [3]: %timeit np.arange(100,