group for filters

Groups input into groups of `group_size`.

Signature

> group {flags} (group_size)

Parameters

  • group_size: the size of each group

Input/output types:

input output
list<any> list<list<any>>

Examples

Group the a list by pairs

> [1 2 3 4] | group 2
╭───┬───────────╮
│ 0 │ ╭───┬───╮ │
│   │ │ 0 │ 1 │ │
│   │ │ 1 │ 2 │ │
│   │ ╰───┴───╯ │
│ 1 │ ╭───┬───╮ │
│   │ │ 0 │ 3 │ │
│   │ │ 1 │ 4 │ │
│   │ ╰───┴───╯ │
╰───┴───────────╯