Numpy signal processing: Efficiently summarize subarrays of consecutive nonzero elements
so, I’m working with FFT data that when thoroughly cleaned should look like many many zeros and an occasional large number. What I have at the moment is many zeros and an occasional short subarray of largish numbers. as an example, ydata=np.array([0,0,0,0,1,2,3,0,0,9,3, 1, 0, 2, 9, 0]) xdata=np.array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]) I’m using an array of consecutive integers… Read More Numpy signal processing: Efficiently summarize subarrays of consecutive nonzero elements