fractional_slice¶
- emlib.misc.fractional_slice(seq, step, start=0, end=-1)[source]¶
Take a slice similar to seq[start:end:step] with fractional step
- Parameters:
seq (
Sequence[TypeVar(T)]) – the sequence of elementsstep (
float) – the step sizestart – start index
end – end index
- Return type:
list[TypeVar(T)]- Returns:
the resulting list
Example
>>> fractional_slice(range(10), 1.5) >>> [0, 2, 3, 5, 6, 8]