Skip to content
Snippets Groups Projects
slip_beginnings.py~ 268 B
Newer Older
podlesny's avatar
podlesny committed
import numpy as np

def slip_beginnings(x) :
    # returns indicies i for which x[i-1]=0 and x[i]>0  
    starts = []
    prev = False
    for i in range(len(x)) :
        if (not prev and x[i]) :
            starts.append(i)
            prev = x[i]
    return starts