GatherEvery / List Layer

Create sublists by selecting every nth element starting from a specified offset. Similar to Polars' list.gather_every(). Returns a list column containing regularly spaced elements from each input list.

Example transformation:

listsnoffsetresult
[1, 2, 3, 4, 5]20[1, 3, 5]
[6, 7, 8]11[7, 8]
[9, 10, 11, 12]30[9, 12]
[]20[]

Common applications:

  • Downsampling time series data
  • Regular sampling from sequences
  • Creating strided subsequences
  • Periodic data extraction
  • Pattern analysis at regular intervals

Note: If n or offset is larger than list length, returns empty list. Supports both fixed values and column references for n and offset.

Table
0
0
Table

Select

column

The source list column to gather from. Examples:

  • Time series: [t1, t2, t3, t4, t5]
  • Measurements: [m1, m2, m3, m4]
  • Sequences: [a, b, c, d, e, f] Lists can have different lengths
FixedN
0

Take every nth element. Examples:

  • 1: Take every element
  • 2: Take every second element
  • 3: Take every third element Must be greater than 0

SelectN

column

Column containing n values. Each row can have different sampling intervals

Offset

oneof
FixedOffset

Starting position for gathering. Examples:

  • 0: Start from first element
  • 1: Start from second element
  • 2: Start from third element

Column containing offset values. Each row can have different starting positions

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.