raise ParameterError("n_segments must be a positive integer")
boundaries = []
idx_slices = [Ellipsis] * data.ndim
for seg_start, seg_end in zip(frames[:-1], frames[1:]):
idx_slices[axis] = slice(seg_start, seg_end)
After Change
raise ParameterError("n_segments must be a positive integer")
boundaries = []
idx_slices = [slice(None)] * data.ndim
for seg_start, seg_end in zip(frames[:-1], frames[1:]):
idx_slices[axis] = slice(seg_start, seg_end)