[SciPy-user] Shift the rows of a matrix

Roger Herikstad roger.herikstad@gmail....
Fri Nov 7 03:12:48 CST 2008

Hi list,
 I was curious if anyone has a good method of shifting individual rows
of a matrix? My problem is that I have a matrix consisting of
waveforms on the rows, and I want to shift each waveform, i.e. pad
with zeros on either end, depending on where the minimum point of each
waveform is located relative to a pre-determined zero point. For
example, if each waveform consists for 32 data points, I would be
interested in aligning each waveform so that the minimum point always
happens on index 10. My current solution is to loop through each
waveform and taking the dot product with a shift matrix, but I'd
rather avoid the for loop if possible. If anyone has any thoughts, I'd
be happy for any input. Thanks!

~ Roger

More information about the SciPy-user mailing list