Skip to content

Make constant

fast step 

Creates a new constant column (with a single unique value) of the same length as the input column.

Usage


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

Step signature
make_constant(input: column, {
    "param": value
}) -> (output: column)

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.

Example

To force the language identifier of a dataset to be all Spanish:

Example call (in recipe editor)
make_constant(ds.lang, {"value": "es"}) -> (ds.lang_es)

Inputs


input: column

An arbitrary input column, used only to match its dimension (number of rows).

Outputs


output: column

Column filled with copies of the value specified in parameters. The data type of the output column will be the one specified by out_type.

Parameters


value: number | string | null | array[string] | array[number]

The value to fill the new column with. The data type of the output column depends on this value and the out_type parameter.


out_type: string

Select types using their name.

Must be one of: "category", "date", "number", "boolean", "url", "sex", "text", "list[number]", "list[category]", "list[url]", "list[boolean]", "list[date]"