Re: [Numpy-discussion] PR Cleanup

2018-09-26 Thread Daπid
On Tue, 25 Sep 2018 at 21:14, Ralf Gommers wrote: > > > On Tue, Sep 25, 2018 at 5:35 PM Marten van Kerkwijk < > m.h.vankerkw...@gmail.com> wrote: > >> Hi Chuck, >> >> Over at astropy we have a bot that sends a warning to PRs that have not >> received any commits for 5 months [1] and closes them i

Re: [Numpy-discussion] matmul as a ufunc

2018-05-29 Thread Daπid
On 29 May 2018 at 05:40, Stephan Hoyer wrote: > But given that idiomatic NumPy code uses 1D arrays in favor of explicit > row/column vectors with shapes (1,n) and (n,1), I do think it does make > sense for matrix transpose on 1D arrays to be the identity, because matrix > transpose should convert

Re: [Numpy-discussion] Proposal of timeline for dropping Python 2.7 support

2017-11-13 Thread Daπid
On 10 November 2017 at 23:03, Robert McLeod wrote: > E.g. in `requirements.txt`: > > numpy;python_version>"3.0" > numpylts; python_version<"3.0" > > In both cases you still call `import numpy` in the code. > For this to be efficient, it should be done soon enough to allow downstream projects

Re: [Numpy-discussion] MATLAB to Numpy

2017-10-21 Thread Daπid
On 21 October 2017 at 22:32, Eric Wieser wrote: > David, that doesn’t work, because np.cumsum(mask)[mask] is always equal > to np.arange(mask.sum()) + 1. Robert’s answer is correct. > Of course, you are right. It makes sense in my head now. ___ NumPy-Di

Re: [Numpy-discussion] MATLAB to Numpy

2017-10-21 Thread Daπid
On 21 October 2017 at 21:03, Robert Kern wrote: > Index with a boolean mask. > > mask = (tmp_px > 2) > px = tmp_px[mask] > py = tmp_py[mask] > # ... etc. > > That isn't equivalent, note that j only increases when tmp_px > 2. I think you can do it with something like: mask = tmp_px > 2 j_values =

Re: [Numpy-discussion] Numpy arrays and slicing comprehension issue

2017-07-08 Thread Daπid
On 8 July 2017 at 13:03, Jaime Fernández del Río wrote: > The last index is exclusive: > [a:b] means a <= index < b. > And the consequence is that the length of your array is b - a, so [:3] gives you the first 3 values. ___ NumPy-Discussion mailing lis

Re: [Numpy-discussion] Set #threads from within python code

2017-03-24 Thread Daπid
On 24 March 2017 at 12:30, Neal Becker wrote: > Using os.environ doesn't > work. I don't understand why. It should, I do that for other variables. Are you setting the variables before importing other libraries? They may only get read at import time. __