screamer.js
    Preparing search index...

    Function split

    • Partition a tagged stream into one stream per source, the inverse of a merge.

      Event i goes to output sources[i], which holds its value (and its index when index is given) in event order. values may have rows: an NdArray of shape [T, ...] or T rows, each event one row. A source is a whole number (a boolean, a fractional or a non-finite source is a TypeError) from 0 to 2147483646 (else a RangeError). There are n outputs, by default max(sources) + 1; an n that would drop an event (n <= max(sources)) is a RangeError. A split makes at most 2**20 outputs: more is a RangeError, raised before anything is allocated.

      Returns { values, index } objects: values a Float64Array for 1-D values, or an NdArray of shape [rows, ...] that keeps the row shape; index a Float64Array, or null without an index. Python's split gives the same values.

      Parameters

      • values:
            | Float64Array<ArrayBufferLike>
            | NdArray
            | ArrayLike<number | null>
            | ArrayLike<ArrayLike<number | null>>
      • sources: ArrayLike<number> | NdArray
      • opts: SplitOptions | null = {}

      Returns SplitOutput[]