To Dict
Take multiple columns and merge them to a dictionary (aka object) using the column headers as keys.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | List of input columns. | array | — | Yes |
output | Name of the output column. | string | — | Yes |
| Options | ||||
include_empty | Whether to include empty columns in the created dictionary. | 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:
- merge.to_dict:
input:
- Col1
- Col2
output: Dict Col
| Col1 | Col2 |
|---|---|
| A | B |
| Dict Col |
|---|
| {'Col1': 'A', 'Col2': 'B'} |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 45 |
| Catalog key | merge.to_dict |
| Recipe key | merge.to_dict |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | merge |
| Documentation group | merge |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.merge.to_dict |
| Legacy UUID | 9b869210-0d89-403b-8409-7cecdb5f9c7c |
Sources