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

# extract_range

> Create a copy of a column nullifying values outside a specified range. 

For columns containing dates, numbers or lists of numbers, values from inside a list are removed, nullifying the list itself when becoming empty.

## 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">
      Replace values outside of range \[rangeLeft, rangeRight) with nulls:

      ```stan theme={null}
      extract_range(ds.price, {"rangeLeft": 200, "rangeRight": 800}) -> (ds.price_clipped)
      ```
    </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}
      extract_range(col_in: date|number|list[number], {
          "param": value,
          ...
      }) -> (col_out: 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="col_in" type="column[date|number|list[number]]" required>
    A column to extract the range from.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="col_out" type="column" required />
</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="rangeLeft" type="[number, string]" required>
    Inclusive left boundary of the selection's range.

    <Accordion title="Examples">
      * 200
      * -0.7
      * 2021-05-07T13:17:53Z
    </Accordion>
  </ParamField>

  <ParamField path="rangeRight" type="[number, string]" required>
    Exclusive right boundary of the selection's range.

    <Accordion title="Examples">
      * 800
      * -0.2
      * 2022-07-07T12:15:03Z
    </Accordion>
  </ParamField>
</Accordion>
