def split_at_breaks(array, breaks, axis=0):
 padded_breaks = concat([[None], breaks, [None]])
 slices = [slice(i, j) for (i, j) in sliding_window(2, padded_breaks)]
 preslice = ((slice(None),) * axis)
 split_array = [array[(preslice + (s,))] for s in slices]
 return split_array

def split_at_breaks ( array , breaks , axis = 0 ) : padded_breaks = concat ( [ [ None ] , breaks , [ None ] ] ) slices = [ slice ( i , j ) for ( i , j ) in sliding_window ( 2 , padded_breaks ) ] preslice = ( ( slice ( None ) , ) * axis ) split_array = [ array [ ( preslice + ( s , ) ) ] for s in slices ] return split_array
split an array into a list of arrays at the given breaks .