Re: [Numpy-discussion] argmax() indexes to value

2019-10-30 Thread Daniele Nicolodi
On 30/10/2019 22:42, Elliot Hallmark wrote: > I wouldn't be surprised at all if calling max in addition to argmax > wasn't as fast or faster than indexing the array using argmax. > Regardless, just use that then profile when you're done with the > whole thing and see if there's any gains to be made

Re: [Numpy-discussion] argmax() indexes to value

2019-10-30 Thread Elliot Hallmark
I wouldn't be surprised at all if calling max in addition to argmax wasn't as fast or faster than indexing the array using argmax. Regardless, just use that then profile when you're done with the whole thing and see if there's any gains to be made. Very likely not here. -elliot On Wed, Oct 30, 20

Re: [Numpy-discussion] argmax() indexes to value

2019-10-30 Thread Daniele Nicolodi
On 30/10/2019 19:10, Neal Becker wrote: > max(axis=1)? Hi Neal, I should have been more precise in stating the problem. Getting the values in the array for which I'm looking at the maxima is only one step in a more complex piece of code for which I need the indexes along the second axis of the ar

Re: [Numpy-discussion] argmax() indexes to value

2019-10-30 Thread Neal Becker
max(axis=1)? On Wed, Oct 30, 2019, 7:33 PM Daniele Nicolodi wrote: > Hello, > > this is a very basic question, but I cannot find a satisfying answer. > Assume a is a 2D array and that I get the index of the maximum value > along the second dimension: > > i = a.argmax(axis=1) > > Is there a bette

[Numpy-discussion] argmax() indexes to value

2019-10-30 Thread Daniele Nicolodi
Hello, this is a very basic question, but I cannot find a satisfying answer. Assume a is a 2D array and that I get the index of the maximum value along the second dimension: i = a.argmax(axis=1) Is there a better way to get the value of the maximum array entries along the second axis other than: