compress
compress<
T>(data:Iterable<T>,selectors:Iterable<unknown>):T[]
Defined in: packages/pythonlib/src/itertools.ts:273
Return elements from iterable where the corresponding selector is true compress([1, 2, 3, 4, 5], [1, 0, 1, 0, 1]) -> [1, 3, 5]
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
data | Iterable<T> |
selectors | Iterable<unknown> |
Returns
T[]