Skip to main content

To Dict

Take multiple columns and merge them to a dictionary (aka object) using the column headers as keys.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputList of input columns.array—Yes
outputName of the output column.string—Yes
Options
include_emptyWhether to include empty columns in the created dictionary.booleanfalseNo
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues 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
Col1Col2
AB
Dict Col
{'Col1': 'A', 'Col2': 'B'}
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID45
Catalog keymerge.to_dict
Recipe keymerge.to_dict
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacemerge
Documentation groupmerge
AliasesNone
Runtime symbolwrangles.recipe_wrangles.merge.to_dict
Legacy UUID9b869210-0d89-403b-8409-7cecdb5f9c7c

Sources