start, stop and step to define a range of indices, the corresponding range of elements is extracted
from each text or list in the input column.
Note: indices start at 0, and a stop of 3 means elements up to but not including the element at index 3
will be extracted. In particular this means simply specifying "stop": 3 (setting or leaving start at its
default of 0), will extract 3 elements in total.
Usage
The following examples show how the step can be used in a recipe.Examples
Examples
- Example 1
- Example 2
- Signature
Extract the first 100 characters from a text column
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").
Inputs
Inputs
column[text|list]
required
A column containing texts or lists to extract a range of characters or elements from.
Outputs
Outputs
column
required
Contains the extracted slices. The type depends on the
out_type parameter, and needs to be consistent with the transformation.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
Parameters
[integer, null]
Index of the first element to be extracted from each string or list in the input column.
[integer, null]
Index at which to stop including elements from the list.
The element at the
stop index will not be included. As an example, "start": 0, "stop": 3
will include all elements up to but not including the element at index 3, thus extracting a
total of 3 elements.[integer, null]
default:"1"
Step size used to move from
start to stop index.
E.g., if "step": 2, only every second element from the range [start, stop] is returned.string
Select types using their name.Values must be one of the following:
category date number boolean url sex text currency list[number] list[category] list[url] list[boolean] list[date] list[currency]