# Chalk DataFrames Reference: Set Operations
source: https://docs.chalk.ai/dataframe-docs#section-set-operations

Methods for combining rows from multiple DataFrames.

Both DataFrames must share the same schema (column order may differ). Duplicates are retained; row order is not guaranteed.

## `union(other)`
source: https://docs.chalk.ai/dataframe-docs#DataFrame.union

Combine this DataFrame with another by stacking rows.

Convenience method for unioning with a single DataFrame. Equivalent to `union_all(other)`.

Both DataFrames must have the same schema (different column order is allowed - the output will have the same column order as `self`). Duplicates **are** retained. Row order **is not** preserved.

**See Also**

union_all : Union with multiple DataFrames at once.

**Parameters**

- `other`: `DataFrame`
  DataFrame to union with this DataFrame.

**Returns**

`DataFrame`

**Raises**

- `ValueError`: If schemas don't match.

**Examples**

```python
df1 = DataFrame({"x": [1, 2], "y": [10, 20]})
df2 = DataFrame({"x": [3, 4], "y": [30, 40]})
result = df1.union(df2)
# result contains all 4 rows from df1 and df2, in any order
```

## `union_all(others)`
source: https://docs.chalk.ai/dataframe-docs#DataFrame.union_all

Combine this DataFrame with one or more others by stacking rows.

All DataFrames must have the same schema (different column order is allowed - the output will have the same column order as `self`). Duplicates **are** retained. Row order **is not** preserved.

**Returns**

`DataFrame`

**Raises**

- `ValueError`: If no other DataFrames are provided, or if schemas don't match.

**Examples**

```python
df1 = DataFrame({"x": [1, 2], "y": [10, 20]})
df2 = DataFrame({"x": [3, 4], "y": [30, 40]})
df3 = DataFrame({"x": [5], "y": [50]})
result = df1.union_all(df2, df3)
# result contains all 5 rows from df1, df2, and df3, in any order
```
