Re: [Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Simen Langseth
Dear Jaime: Thank you so much. Your codes are always great. By the way, I have been waiting for several hours to get satisfactory answer at: http://codereview.stackexchange.com/questions/75457/faster-way-of-using-interp1d-in-2d-array?noredirect=1#comment137329_75457 http://stackoverflow.com/ques

Re: [Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Jaime Fernández del Río
On Fri, Jan 2, 2015 at 3:06 AM, Simen Langseth wrote: > import numpy as np > from scipy import signal > > y = np.array([[2, 1, 2, 3, 2, 0, 1, 0], > [2, 1, 2, 3, 2, 0, 1, 0]]) > > maximas = signal.argrelmax(y, axis=1) > > print maximas > > (array([0, 0, 1, 1], dtype=int64), array([3,

[Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Simen Langseth
import numpy as np from scipy import signal y = np.array([[2, 1, 2, 3, 2, 0, 1, 0], [2, 1, 2, 3, 2, 0, 1, 0]]) maximas = signal.argrelmax(y, axis=1) print maximas (array([0, 0, 1, 1], dtype=int64), array([3, 6, 3, 6], dtype=int64)) I want to extract only the first maxima of both