Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-07-02 Thread Rakesh Vasudevan
I agree with the idea of setting apart the parameter from python , "by" sounds like a good alternative Rakesh On Wed, Jul 1, 2020, 18:45 Sebastian Berg wrote: > On Wed, 2020-07-01 at 12:48 -0700, Stephan Hoyer wrote: > > On Wed, Jul 1, 2020 at 12:23 PM Sebastian Berg < > > sebast...@sipsoluti

Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-07-01 Thread Sebastian Berg
On Wed, 2020-07-01 at 12:48 -0700, Stephan Hoyer wrote: > On Wed, Jul 1, 2020 at 12:23 PM Sebastian Berg < > sebast...@sipsolutions.net> > wrote: > > > This is a WIP, but allows nicely to try out how the new API > > could/should look like, and see the potential impact to code. The > > current cho

Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-07-01 Thread Stephan Hoyer
On Wed, Jul 1, 2020 at 12:23 PM Sebastian Berg wrote: > This is a WIP, but allows nicely to try out how the new API > could/should look like, and see the potential impact to code. The > current choice is for: > > np.sort(arr, keys=(arr.real, arr.image)) > > for example. `keys` is like the `

Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-07-01 Thread Sebastian Berg
On Sat, 2020-06-27 at 16:08 -0700, Rakesh Vasudevan wrote: > Hi all, > >Following up on this. Created a WIP PR > https://github.com/numpy/numpy/pull/16700 > > As stated in the original thread, We need to start by having a sort() > function for complex numbers that can do it based on keys, rat

Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-06-27 Thread Rakesh Vasudevan
Hi all, Following up on this. Created a WIP PR https://github.com/numpy/numpy/pull/16700 As stated in the original thread, We need to start by having a sort() function for complex numbers that can do it based on keys, rather than plain arithmetic ordering. There are two broad ways to approach

Re: [Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-06-04 Thread Brock Mendel
Corresponding pandas issue: https://github.com/pandas-dev/pandas/issues/28050 On Thu, Jun 4, 2020 at 9:17 PM Rakesh Vasudevan wrote: > Hi all, > > As a follow up to gh-15981 , > I would like to propose a change to bring complex dtype(s) comparison > o

[Numpy-discussion] Improving Complex Comparison/Ordering in Numpy

2020-06-04 Thread Rakesh Vasudevan
Hi all, As a follow up to gh-15981 , I would like to propose a change to bring complex dtype(s) comparison operators and related functions, in line with respective cpython implementations. The current state of complex dtype comparisons/ordering as summ