I wrote the following code:def find_storms_dst(d_f, max, min):    i = 0    storms = []    while i < len(d_f.index):        dst = d_f['Dst'][i]        if dst < max:            if dst < min:                print 'out of range'            s = Storm(i, d_f.index[i], dst)            while i < len(d_f.index)-1:                i += 1                dst = d_f['Dst'][i]                if dst < max:                    if dst < min:                        print 'out of range'                    s.log(i, d_f.index[i], dst)                else:                    break            storms.append(s)        i += 1    return stormsI does what I want. But I see some elements in it repeat, is that a recursion issue?How one could write this better?
Better way to write algorithm, possibly recursive
python;algorithm;python 2.7