Skip to content

Filter row numbers

Filter rows by row number.

Keeps or drops rows with specific row numbers, i.e. based on their 0-based, consecutive integer index.


The following are the step's expected inputs and outputs and their specific types.

Step signature
filter_row_numbers(ds_in: dataset, {"param": value}) -> (ds_out: dataset)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.


To keep only rows with index 0, 2 and 4 (the first, third and fifth row)

Example call (in recipe editor)
filter_row_numbers(ds, {"row_numbers": [0, 2, 4]}) -> (ds_filtered)


ds_in: dataset

An input dataset to filter.


ds_out: dataset

A new dataset containing the same columns as the input dataset but only those rows passing the filter condition.


row_numbers: array[integer]

Ids of the rows to filter. Excepts either a single row (as a number) or a list of row numbers.

exclude: boolean = False

if true, selected rows will be excluded from the resulting dataset.

Back to top