Re: [Numpy-discussion] Approving NEP 27 - Historical discussion of 0-D arrays

2018-10-17 Thread Stephan Hoyer
On Wed, Oct 17, 2018 at 10:59 AM Matti Picus wrote: > In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old > wiki document discussing the implementation of 0-dimensional arrays. > This became informational NEP-27 > http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html.

Re: [Numpy-discussion] Approving NEP 27 - Historical discussion of 0-D arrays

2018-10-17 Thread Stephan Hoyer
On Wed, Oct 17, 2018 at 4:16 PM Stefan van der Walt wrote: > On Wed, 17 Oct 2018 20:58:55 +0300, Matti Picus wrote: > > http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was > > fruitful discussion of the NEP and the need for both 0-D arrays and > scalars > > on the PR comments. >

Re: [Numpy-discussion] Approving NEP 27 - Historical discussion of 0-D arrays

2018-10-17 Thread Stefan van der Walt
On Wed, 17 Oct 2018 20:58:55 +0300, Matti Picus wrote: > http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was > fruitful discussion of the NEP and the need for both 0-D arrays and scalars > on the PR comments. Were those comments integrated back into the NEP? If not, can we add a

Re: [Numpy-discussion] BIDS/NumPy dev meetings, Wednesdays 12pm Pacific

2018-10-17 Thread Hameer Abbasi
Dial in: https://berkeley.zoom.us/zoomconference?m=ta2dUMqcdK219Ov78Sj7CMIzzoX2CHGZ Join in via PC: https://berkeley.zoom.us/j/400054438 Best Regards, Hameer Abbasi > On Wednesday, Oct 17, 2018 at 8:59 PM, Mark Harfouche > mailto:mark.harfou...@gmail.com)> wrote: > Stefan. I would like to

Re: [Numpy-discussion] BIDS/NumPy dev meetings, Wednesdays 12pm Pacific

2018-10-17 Thread Mark Harfouche
Stefan. I would like to simply listen in. I cant seem to find the meeting ID that we need to call in. On Tue, Oct 16, 2018 at 6:42 PM Allan Haldane wrote: > I'll try to make it, especially as it looks like you want to discuss two > of my PRs! :) > > I have a different meeting a bit before then

Re: [Numpy-discussion] Approving NEP 27 - Historical discussion of 0-D arrays

2018-10-17 Thread Hameer Abbasi
Hi everyone, Ah, I neglected to see that the PR was already merged. In any case, I’ll repeat my comment here (referring to the indexing section): I would suggest that this section be removed entirely or updated. For example, if xis either an array scalar or a rank zero array, x[...] is

Re: [Numpy-discussion] random.choice(replace=False) very slow

2018-10-17 Thread Hameer Abbasi
Hi! The standard algorithm for sampling without replacement is ``O(N)`` expected for ``N < 0.5 * M`` where ``M`` is the length of the original set, but ``O(N^2)`` worst-case. When this is not true, a simple Durstenfeld-Fisher-Yates shuffle [1] (``O(M)``) can be used on the original set and

[Numpy-discussion] Approving NEP 27 - Historical discussion of 0-D arrays

2018-10-17 Thread Matti Picus
In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old wiki document discussing the implementation of 0-dimensional arrays. This became informational NEP-27 http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was fruitful discussion of the NEP and the need for

[Numpy-discussion] random.choice(replace=False) very slow

2018-10-17 Thread Matthew Brett
Hi, I noticed that numpy.random.choice was very slow, with the replace=False option, and then I noticed it can (for most cases) be made many hundreds of times faster in Python code: In [18]: sample = np.random.uniform(size=100) In [19]: timeit np.random.choice(sample, 500, replace=False)