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

# append_rows

> Add rows from one dataset to another. 

I.e., vertically concatenates two datasets, appending the rows of the second to the end of the first.

When the two datasets contain different columns, the `join` parameter controls whether only the
common columns are kept (`inner`), or all columns (`outer`). In the latter case, rows will have missing
values (NaNs), where a column only existed in one of the two datasets.

## 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 append the rows of dataset `ds_right` to the dataset `ds_left`, keeping all columns from both datasets:

      ```stan theme={null}
      append_rows(ds_left, ds_right) -> (ds_out)
      ```
    </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}
      append_rows(ds_left: dataset, ds_right: dataset, {
          "param": value,
          ...
      }) -> (result: dataset)
      ```
    </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="ds_left" type="dataset" required>
    An input dataset.
  </ParamField>

  <ParamField path="ds_right" type="dataset" required>
    A second dataset whose rows to append below the original dataset (`ds_left`).
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="result" type="dataset" required>
    A dataset containing the rows of both `ds_left`, and `ds_right`,
    as well as an aditional column `original_index` indicating the index of each row in its original dataset.
  </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="join" type="string" default="outer" required>
    Whether to do concatenate using an "inner" or "outer" join of columns.
    When `"inner"`, only common columns will be kept. When `"outer"`, all columns will be kept.

    Values must be one of the following:

    * `inner`
    * `outer`
  </ParamField>
</Accordion>
