Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Cameron Blocker
I would love for there to be .H property. I have .conj().T in almost every math function that I write so that it will be general enough for complex numbers. Besides being less readable, what puts me in a bind is trying to accommodate LinearOperator/LinearMap like duck type objects in place of

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Stephan Hoyer
On Mon, Jun 24, 2019 at 5:36 PM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > > > On Mon, Jun 24, 2019 at 7:21 PM Stephan Hoyer wrote: > >> On Mon, Jun 24, 2019 at 3:56 PM Allan Haldane >> wrote: >> >>> I'm not at all set on that behavior and we can do something else. For >>> now, I

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Marten van Kerkwijk
On Mon, Jun 24, 2019 at 7:21 PM Stephan Hoyer wrote: > On Mon, Jun 24, 2019 at 3:56 PM Allan Haldane > wrote: > >> I'm not at all set on that behavior and we can do something else. For >> now, I chose this way since it seemed to best match the "IGNORE" mask >> behavior. >> >> The behavior you

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Marten van Kerkwijk
Hi Allan, > The alternative solution in my model would be to replace `np.dot` with a > > masked-specific implementation of what `np.dot` is supposed to stand for > > (in your simple example, `np.add.reduce(np.multiply(m, m))` - more > > generally, add relevant `outer` and `axes`). This would be

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Stephan Hoyer
On Mon, Jun 24, 2019 at 3:56 PM Allan Haldane wrote: > I'm not at all set on that behavior and we can do something else. For > now, I chose this way since it seemed to best match the "IGNORE" mask > behavior. > > The behavior you described further above where the output row/col would > be masked

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Allan Haldane
On 6/24/19 3:09 PM, Marten van Kerkwijk wrote: > Hi Allan, > > Thanks for bringing up the noclobber explicitly (and Stephan for asking > for clarification; I was similarly confused). > > It does clarify the difference in mental picture. In mine, the operation > would indeed be guaranteed to be

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Charles R Harris
On Mon, Jun 24, 2019 at 3:40 PM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > Hi Eric, > > The easiest definitely is for the mask to just propagate, which that even > if just one point is masked, all points in the fft will be masked. > > On the direct point I made, I think it is

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Eric Firing
On 2019/06/24 11:39 AM, Marten van Kerkwijk wrote: Hi Eric, The easiest definitely is for the mask to just propagate, which that even if just one point is masked, all points in the fft will be masked. This is perfectly reasonable, and consistent with what happens with nans, of course. My

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Warren Weckesser
On 6/24/19, Marten van Kerkwijk wrote: > Hi Eric, > > The easiest definitely is for the mask to just propagate, which that even > if just one point is masked, all points in the fft will be masked. > > On the direct point I made, I think it is correct that since one can think > of the Fourier

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Marten van Kerkwijk
Hi Eric, The easiest definitely is for the mask to just propagate, which that even if just one point is masked, all points in the fft will be masked. On the direct point I made, I think it is correct that since one can think of the Fourier transform of a sine/cosine fit, then there is a solution

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Eric Firing
On 2019/06/24 9:09 AM, Marten van Kerkwijk wrote: Another example of a function for which I think my model is not particularly insightful (and for which it is difficult to know what to do generally) is `np.fft.fft`. Since an fft is equivalent to a sine/cosine fits to data points, the answer

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Marten van Kerkwijk
Hi Allan, Thanks for bringing up the noclobber explicitly (and Stephan for asking for clarification; I was similarly confused). It does clarify the difference in mental picture. In mine, the operation would indeed be guaranteed to be done on the underlying data, without copy and without

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Marten van Kerkwijk
Hi Stephan, Yes, the complex conjugate dtype would make things a lot faster, but I don't quite see why we would wait for that with introducing the `.H` property. I do agree that `.H` is the correct name, giving most immediate clarity (i.e., people who know what conjugate transpose is, will

Re: [Numpy-discussion] NumPy Community Meeting Thursday, June 27

2019-06-24 Thread Sebastian Berg
Sorry, Thursday is the 27th of course. On Mon, 2019-06-24 at 11:02 -0700, Sebastian Berg wrote: > Hi all, > > There will be a NumPy Community meeting on _Thursday_ June 26 at 11 > am > Pacific Time. Everyone is invited to join in and edit the work-in- > progress meeting notes:

[Numpy-discussion] NumPy Community Meeting Thursday, June 26

2019-06-24 Thread Sebastian Berg
Hi all, There will be a NumPy Community meeting on _Thursday_ June 26 at 11 am Pacific Time. Everyone is invited to join in and edit the work-in- progress meeting notes: https://hackmd.io/76o-IxCjQX2mOXO_wwkcpg?both Best wishes Sebastian PS: We decided to move to Thursday, since at least

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Allan Haldane
On 6/24/19 12:16 PM, Stephan Hoyer wrote: > On Mon, Jun 24, 2019 at 8:46 AM Allan Haldane > wrote: > >  1. Making a "no-clobber" guarantee on the underlying data > > > Hi Allan -- could kindly clarify what you mean by "no-clobber"? > > Is this referring to

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Stephan Hoyer
On Mon, Jun 24, 2019 at 8:46 AM Allan Haldane wrote: > 1. Making a "no-clobber" guarantee on the underlying data > Hi Allan -- could kindly clarify what you mean by "no-clobber"? Is this referring to allowing masked arrays to mutate masked data values in-place, even on apparently non-in-place

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Allan Haldane
On 6/24/19 11:46 AM, Allan Haldane wrote: > A no-clobber guarantee makes your "iterative mask" example solvable in > an efficient (no-copy) way: > > mask, last_mask = False > while True: > dat_mean = np.mean(MaskedArray(data, mask)) > mask, last_mask = np.abs(data - mask)

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Allan Haldane
On 6/23/19 6:58 PM, Eric Wieser wrote: > I think we’d need to consider separately the operation on the mask > and on the data. In my proposal, the data would always do > |np.sum(array, where=~mask)|, while how the mask would propagate > might depend on the mask itself, > > I quite

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Stephan Hoyer
On Mon, Jun 24, 2019 at 8:10 AM Todd wrote: > On Mon, Jun 24, 2019 at 11:00 AM Stephan Hoyer wrote: > >> On Sun, Jun 23, 2019 at 10:05 PM Stewart Clelland < >> stewartclell...@gmail.com> wrote: >> >>> Hi All, >>> >>> Based on discussion with Marten on github >>>

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Allan Haldane
On 6/22/19 11:50 AM, Marten van Kerkwijk wrote: > Hi Allan, > > I'm not sure I would go too much by what the old MaskedArray class did. > It indeed made an effort not to overwrite masked values with a new > result, even to the extend of copying back masked input data elements to > the output

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Alan Isaac
Iirc, that works only on (2-d) matrices. Cheers, Alan Isaac On 6/24/2019 10:45 AM, Todd wrote: I think the corresponding MATLAB function/operation is this: https://www.mathworks.com/help/matlab/ref/transpose.html ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Todd
On Mon, Jun 24, 2019 at 11:00 AM Stephan Hoyer wrote: > On Sun, Jun 23, 2019 at 10:05 PM Stewart Clelland < > stewartclell...@gmail.com> wrote: > >> Hi All, >> >> Based on discussion with Marten on github >> , I have a couple of >> suggestions on

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Alan Isaac
Points of reference: Mathematica: https://reference.wolfram.com/language/ref/Transpose.html Matlab: https://www.mathworks.com/help/matlab/ref/permute.html Personally I would find any divergence between a.T and a.transpose() to be rather surprising. Cheers, Alan Isaac

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Todd
I think we need to do something about the 1D case. I know from a strict mathematical standpoint it doesn't do anything, and philosophically we should avoid special cases, but I think the current solution leads to enough confusion and silently doing an unexpected thing that I think we need a

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Hameer Abbasi
Given that np.dot and np.matmul do the right thing for 1-D arrays, I would be opposed to introducing an error as well. From: NumPy-Discussion on behalf of Ilhan Polat Reply-To: Discussion of Numerical Python Date: Monday, 24. June 2019 at 11:58 To: Discussion of Numerical Python

Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Ilhan Polat
Please don't introduce more errors for 1D arrays. They are already very counter-intuitive for transposition and for other details not relevant to this issue. Emitting errors for such a basic operation is very bad for user experience. This already is the case with wildly changing slicing syntax. It

[Numpy-discussion] [JOB] Full-time opportunity – Software engineer for open source project

2019-06-24 Thread Umberto Lupo
Who we are L2F is a start-up based on the EPFL Innovation Park (Lausanne, Switzerland). We are currently working at the frontier of machine learning and topological data analysis, in collaboration with several academic partners. Our Mission We are developing an open source Python library