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.

Example

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

filter_row_numbers(ds, {"row_numbers": [0, 2, 4]}) -> (ds_filtered)

Usage

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

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.

Inputs


ds_in: dataset

An input dataset to filter.

Outputs


ds_out: dataset

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

Parameters


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.