Lists
Compare multiple lists and return the intersection, difference, or union.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | List of input columns containing lists to compare. | array | — | Yes |
output | Name of the output column. | string | — | Yes |
| Options | ||||
method | Type of comparison to perform. | string; one of:
| "intersection" | No |
remove_duplicates | Remove duplicates from the result. | boolean | false | No |
ignore_case | Ignore case when comparing string items. | boolean | false | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
Examples
wrangles:
- compare.lists:
input:
- col1
- col2
output: Difference
method: difference
| Col1 | Col2 |
|---|---|
| [A, B, C] | [C, D, E] |
| [H, I, J, K] | [H, I, J] |
| [X, Y, Z] | [1, 2, 3] |
| Difference |
|---|
| [A, B] |
| [K] |
| [X, Y, Z] |
wrangles:
- compare.lists:
input:
- col1
- col2
output: Intersection
method: intersection
| Col1 | Col2 |
|---|---|
| [A, B, C] | [C, D, E] |
| [H, I, J, K] | [H, I, J] |
| [X, Y, Z] | [1, 2, 3] |
| Intersection |
|---|
| [C] |
| [H, I, J] |
| [] |
wrangles:
- compare.lists:
input:
- col1
- col2
output: Union
method: union
| Col1 | Col2 |
|---|---|
| [A, B, C] | [C, D, E] |
| [H, I, J, K] | [H, I, J] |
| [X, Y, Z] | [1, 2, 3] |
| Union |
|---|
| [A, B, C, D, E] |
| [H, I, J, K] |
| [X, Y, Z, 1, 2, 3] |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 1 |
| Catalog key | compare.lists |
| Recipe key | compare.lists |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | compare |
| Documentation group | compare |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.compare.lists |
| Legacy UUID | a393225e-7ccf-4708-83f8-d5abd6ba9b1e |
Sources