I have numpy array named data_saw that contains thousands of float numbers.
When visualized, it looks like this

My task is to shift down each element before gap by 180 (because each gap range here is around 180), so I will get continuous growing only line without gaps

I've ended up with looping through array and checking for a gap at every index (the last element is for comparison only and is not needed in further calculations, so it is just deleted after alignment):
for i in range(1, len(data_saw)):
if data_saw[i - 1] > data_saw[i]:
data_saw[:i] -= 180
data_saw = np.delete(data_saw, -1)
Trying to find out if there are more correct ways to do this with numpy array. Are there any?

