Skip to main content

Usage

The following examples show how the step can be used in a recipe.

Examples

  • Example 1
  • Example 2
  • Signature
To create a new dataset keeping only those rows where values in the “salary” column are either “low” or “high”.
filter_values(ds, {"column": "salary", "values": ["low", "high"]}) -> (ds_filtered)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
ds_in
dataset
required
An input dataset to filter.
ds_out
dataset
required
A new dataset containing the same columns as the input dataset but only those rows passing the filter condition.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

column
string (ds_in.column)
required
Name of column to be matched against the specified values.
values
[number, string, array[['number', 'string']]]
required
Only rows matching these values exactly will be included in the resulting dataset. May be a single value or a list of values to be matched.
Item
[number, string]
Each item in array.
  • the
  • [‘the’, ‘cat’]
  • 2
  • [2, 3]
exclude
boolean
default:"false"
if true, only rows not matching the specified values will be included in the resulting dataset.
I