> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# make_constant

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

## Usage

The following example shows how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      To force the language identifier of a dataset to be all Spanish:

      ```stan theme={null}
      make_constant(ds.lang, {"value": "es"}) -> (ds.lang_es)
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      make_constant(input: column, {
          "param": value,
          ...
      }) -> (output: column)
      ```
    </Tab>
  </Tabs>
</Accordion>

## 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"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="input" type="column" required>
    An arbitrary input column, used only to match its dimension (number of rows).
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="output" type="column" required>
    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.
  </ParamField>
</Accordion>

## 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)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="value" type="[string, number, null, array, array]" required>
    The value to fill the new column with.
    The data type of the output column depends on this value and the `out_type` parameter.

    <Accordion title="Options">
      <Tabs>
        <Tab title="String">
          <ParamField path="{_}" type="string">
            A single string.
          </ParamField>
        </Tab>

        <Tab title="Number">
          <ParamField path="{_}" type="number">
            A single number.
          </ParamField>
        </Tab>

        <Tab title="Null">
          <ParamField path="{_}" type="null">
            A null value.
          </ParamField>
        </Tab>

        <Tab title="String array">
          <ParamField path="{_}" type="array[string]">
            Array of strings.

            <Accordion title="Array items">
              <ParamField path="Item" type="string">
                Each item in array.
              </ParamField>
            </Accordion>
          </ParamField>
        </Tab>

        <Tab title="Number array">
          <ParamField path="{_}" type="array[number]">
            Array of numbers.

            <Accordion title="Array items">
              <ParamField path="Item" type="number">
                Each item in array.
              </ParamField>
            </Accordion>
          </ParamField>
        </Tab>
      </Tabs>
    </Accordion>
  </ParamField>

  <ParamField path="out_type" type="string" required>
    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]`
  </ParamField>
</Accordion>
