Skip to main content

Split Wrangles

Split wrangles, with recipe examples, parameters, and behavior.

Explode​

Explode a column of lists into rows.

Explode a column of lists into rows

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the column(s) to explode. If multiple columns are included they must contain lists of the same length.string, integer, array—Yes
Options
drop_emptyIf true, any rows that contain an empty list will be dropped. If false, rows that contain empty lists will keep 1 row with an empty value. Default False.booleanfalseNo
Formatting
reset_indexReset the index after exploding. Default True.booleantrueNo
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:
- explode:
input: Products
ProductsManufacturer
[Ball Bearing, Bearing Seal]SKF
[Angle Grinder, Drill, Impact Driver]Milwaukee
Solid State RelaySchneider
ProductsManufacturer
Ball BearingSKF
Bearing SealSKF
Angle GrinderMilwaukee
DrillMilwaukee
Impact DriverMilwaukee
Solid State RelaySchneider
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID77
Catalog keyexplode
Recipe keyexplode
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.pandas.explode
Legacy UUID4e4b13ac-8d50-4b2c-85c8-2c31de1e817d

Sources


Dictionary​

Split one or more dictionaries into columns. The dictionary keys will be returned as the new column headers. If the dictionaries contain overlapping values, the last value will be returned.

Split a dictionary into columns. The dictionary keys are used as the new column headers.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName or lists of the column(s) containing dictionaries to be split. If providing multiple dictionaries and the dictionaries contain overlapping values, the last value will be returned.string, integer, array—Yes
outputIn columns output_format, this is an optional subset of keys to extract from the dictionary. If not provided, all keys will be returned. Columns can be renamed with the following syntax: output: - key1: new_column_name1 - key2: new_column_name2 In to_lists output_format, this must be two output columns for the keys and values lists. If not provided, Keys and Values will be used.string, array, nullnullNo
Formatting
output_formatHow to split the dictionary. columns creates one output column for each dictionary key. to_lists creates two output columns containing lists of keys and values.string; one of:
  • columns
  • to_lists
"columns"No
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
Errors
defaultProvide a set of default headings and values if they are not found within the input.object, nullnullNo

Examples​

wrangles:
- split.dictionary:
input: Column
# Output not required
Column
{'Col1': 'A', 'Col2': 'B', 'Col3': 'C'}
Col1Col2Col3
ABC
wrangles:
- split.dictionary:
input: Column
output: Col2
Column
{'Col1': 'A', 'Col2': 'B', 'Col3': 'C'}
Col2
B
wrangles:
- split.dictionary:
input: Column
output: Col*
Column
{'Col1': 'A', 'Col2': 'B', 'Other': 'C'}
Col1Col2
AB
wrangles:
- split.dictionary:
input: Column
output: "regex: .*3"
Column
{'Col1': 'A', 'Col2': 'B', 'Col3': 'C'}
Col3
C
wrangles:
- split.dictionary:
input: Column
output:
- Col1: Column 1
- Col2: Column 2
Column
{'Col1': 'A', 'Col2': 'B', 'Col3': 'C'}
Column 1Column 2
AB
wrangles:
- split.dictionary:
input: Column
output:
- Col*: Column *
Column
{'Col1': 'A', 'Col2': 'B', 'Col3': 'C'}
Column 1Column 2Column 3
ABC
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID63
Catalog keysplit.dictionary
Recipe keysplit.dictionary
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacesplit
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.split.dictionary
Legacy UUID06ca98e4-d026-43f7-84eb-af246d401ba9

Sources


List​

Split a list in a single column to multiple columns.

Split a list into multiple columns. If only one output is given, split.list returns the same list it was given, so output should be a list of columns or a column name with a wildcard (*).

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the column to be split.string, integer—Yes
outputName of column(s) for the results. If providing a single column, use a wildcard (*) to indicate a incrementing integer.string, array—Yes
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:
- split.list:
input: Column
output: Column*
Column
['A', 'B', 'C']
Column1Column2Column3
ABC
wrangles:
- split.list:
input: Column
output:
- Heading A
- Heading B
- Heading C
Column
['A', 'B', 'C']
Heading AHeading BHeading C
ABC
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID64
Catalog keysplit.list
Recipe keysplit.list
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacesplit
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.split.list
Legacy UUID3260b9f7-aae2-499f-8004-d211c2cf643e

Sources


Text​

Split a string to multiple columns or a list.

Split text strings on certain characters. The text can be split into either multiple columns or a list.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the column to be split.string—Yes
outputName of the output column(s) If a single column is provided, the results will be returned as a list If multiple columns are listed, the results will be separated into the columns. If omitted, will overwrite the input.string, array, nullnullNo
Options
charSet the character(s) to split on. Default comma (,) Can also prefix with "regex:" to split on a pattern.string","No
elementSelect a specific element or range after splitting using slicing syntax. e.g. 0, ":5", "5:", "2:8:2".string, integer, nullnullNo
inclusiveIf true, include the split character in the output. Default False.booleanfalseNo
skip_emptyWhether to skip empty values.booleanfalseNo
Formatting
padChoose whether to pad to ensure a consistent length. Default true if outputting to columns, false for lists.boolean, nullnullNo
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:
- split.text:
input: Column1
output: Column2
char: ', '
Column1
Hello, Wrangles!
Column2
['Hello', 'Wrangles!']
# Split on x, case insensitive.
wrangles:
- split.text:
input: Col1
output: Col2
char: 'regex:(?i)x'
Col1
1x2
1X2
Col2
['1', '2']
['1', '2']
wrangles:
- split.text:
input: Column1
output: Column2
char: ', '
element: 0
Column1
Hello, Wrangles!
Column2
Hello
wrangles:
- split.text:
input: Col
output: Col* # Optional
char: ', '
Col
Hello, Wrangles!
Col1Col2
HelloWrangles!
wrangles:
- split.text:
input: Col
output:
- Col 1
- Col 2
- Col 3
char: ', '
Col
Wrangles, are, Cool!
Col 1Col 2Col 3
WranglesareCool!
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID65
Catalog keysplit.text
Recipe keysplit.text
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacesplit
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.split.text
Legacy UUIDe76e43f7-d129-4bf8-87b4-a304a378b130

Sources


Tokenize​

Split text into tokens. A variety of methods are available. The default method is to split on spaces.

Tokenize elements in a list or string into individual tokens.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputColumn(s) to be split into tokens.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Options
methodMethod to split the list. Options include space, boundary, boundary_ignore_space, custom functions as custom.<function>, or regex patterns as regex:<pattern>.string; one of:
  • space
  • boundary
  • boundary_ignore_space
or string
"space"No
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:
- split.tokenize:
input: Materials
output: Tokenized List
Materials
Stainless Steel Oak Wood
Tokenized List
['Stainless', 'Steel', 'Oak', 'Wood']
wrangles:
- split.tokenize:
input: Materials
output: Tokenized List
Materials
['Stainless Steel', 'Oak Wood']
Tokenized List
['Stainless', 'Steel', 'Oak', 'Wood']
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID66
Catalog keysplit.tokenize
Recipe keysplit.tokenize
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacesplit
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.split.tokenize
Legacy UUID6cc88418-ae0c-43f6-84ee-31e0d5f838c3

Sources