Skip to main content

Format Wrangles

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

Clean Whitespaces​

Condense multiple spaces to a single space and convert special space characters to a standard space.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName or list of input columns.string, integer, array—Yes
outputName or list of output columns.string, array, nullnullNo
Options
trimWhether to trim leading and trailing spaces. Default True.booleantrueNo
remove_literalsWhether to remove special space characters such as new lines etc. 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:
- clean_whitespaces:
input: Products
Products
Hello world!
Hello universe!
Products
Hello world!
Hello universe!
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID72
Catalog keyclean_whitespaces
Recipe keyclean_whitespaces
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.clean_whitespaces
Legacy UUIDe36e15c4-f0ad-43f8-8555-ef683a8ab892

Sources


Dates​

Format a date.

Format a date into the desired pattern.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Formatting
formatString pattern to format date.string—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:
- format.dates:
input: Date
output: Output Format
format: '%Y-%m-%d' # must be wrapped by quotes " or '
Date
6/23/1912
Output Format
1912-06-23
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID31
Catalog keyformat.dates
Recipe keyformat.dates
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.dates
Legacy UUIDa3c15135-4f7a-4659-83fd-f657afa603c9

Sources


Pad​

Pad a string to a fixed length.

Pad a string to a fixed length

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Options
sideSide from which to fill resulting string.string—Yes
skip_emptyIf true, skip padding for empty or whitespace-only values.booleanfalseNo
Formatting
pad_lengthLength for the output.integer—Yes
charThe character to pad the input with.string—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:
- format.pad:
input: Part Number
pad_length: 5
side: left
char: "-"
Part Number
0458
396
84
98516
Part Number
-0458
--396
---84
98516
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID32
Catalog keyformat.pad
Recipe keyformat.pad
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.pad
Legacy UUID76c19378-38f4-45aa-85d1-3cdf8f8aae29

Sources


Prefix​

Add a prefix to a column.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
output(Optional) Name of the output column.string, array, nullnullNo
Options
valuePrefix value to add.string, integer, number—Yes
skip_emptyWhether to skip empty values.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:
- format.prefix:
input: Data
output: Prefix
value: anti
Data
freeze
dote
hero
Prefix
antifreeze
antidote
antihero
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID33
Catalog keyformat.prefix
Recipe keyformat.prefix
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.prefix
Legacy UUIDc12f99b9-2363-4da7-8405-7c73b87906e5

Sources


Format Price Breaks​

Expand non-empty price-break cells into paired category and value columns.

Behavior​

Expand non-empty price-break cells into paired category and value columns.

This guidance was derived from the callable signature.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of input columns.array—Yes
Formatting
categoryLabelPrefix for output columns that identify the source price-break category.string—Yes
valueLabelPrefix for output columns that contain the corresponding price-break value.string—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
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID34
Catalog keyformat.price_breaks
Recipe keyformat.price_breaks
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleNo
Recipe Writer exclusionThis newer wrangle is outside the pinned baseline.
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.price_breaks
Legacy UUIDNone

Sources


Remove Duplicates​

Remove duplicates from a list. Preserves input order.

Remove duplicate values in a list.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Options
ignore_caseIgnore case when removing duplicates.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:
- format.remove_duplicates:
input: Attack of the Clones
output: Commander
where: Rank = Commander
RankAttack of the Clones
Commander['Cody', 'Cody', 'Cody']
Captain['Rex', 'Rex', 'Rex']
Commander
['Cody']
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID35
Catalog keyformat.remove_duplicates
Recipe keyformat.remove_duplicates
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.remove_duplicates
Legacy UUID283b9e78-b2b2-43d0-844f-9842c33120aa

Sources


Significant Figures​

Format a value to a specific number of significant figures.

Format a value to a specific number of significant figures

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Formatting
significant_figuresNumber of significant figures to format to. Default is 3.integer3No
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:
- format.significant_figures:
input: Data
significant_figures: 2
output: Data to 2 Figures
Data
1.25
12.3
55.6
Data to 2 Figures
1.2
12
55
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID36
Catalog keyformat.significant_figures
Recipe keyformat.significant_figures
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.significant_figures
Legacy UUIDa359f72a-5250-4dd8-84f6-8a8173bee0f6

Sources


Suffix​

Add a suffix to a column.

Add a suffix to a column

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
output(Optional) Name of the output column.string, nullnullNo
Options
valueSuffix value to add.string, integer, number, array—Yes
skip_emptyWhether to skip empty values.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:
- format.suffix:
input: Data
output: Suffix
value: ic
Data
sto
hero
icon
Suffix
stoic
heroic
iconic
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID37
Catalog keyformat.suffix
Recipe keyformat.suffix
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.suffix
Legacy UUID8d127060-ba2d-4934-897f-07662e01e40b

Sources


Trim​

Remove excess whitespace at the start and end of text.

Remove excess whitespace at the start and end of text. Can accept multiple columns.

note

Non-string values pass through unaltered.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, 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:
- format.trim:
input:
- col1
output: col1 trimmed
col1
Hello World
col1col1 trimmed
Hello WorldHello World
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID38
Catalog keyformat.trim
Recipe keyformat.trim
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.trim
Legacy UUIDaf16b3c1-c230-4868-8ebe-f574904a0c76

Sources


Remove Words​

Remove all the elements that occur in one list from another.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of column to remove words from.string, integer, array—Yes
to_removeColumn or list of columns with a list of words to be removed.string—Yes
outputName of the output columns.string, array, nullnullNo
Options
tokenize_to_removeTokenize all to_remove inputs.booleanfalseNo
ignore_caseIgnore input and to_remove case.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:
- remove_words:
input: Description
to_remove: # To Remove columns must be list
- Materials
- Colours
output: Product
tokenize_to_remove: True
ignore_case: False
ColoursMaterialsDescription
['Blue']['Steel']Steel Blue Bottle
['Blue']['Steel']['Steel', 'Blue', 'Bottle']
Product
Bottle
Bottle
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID88
Catalog keyremove_words
Recipe keyremove_words
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.remove_words
Legacy UUID543b96c3-f354-48be-8046-bf0cb9fbaf56

Sources


Replace​

Quick find and replace for simple values. Can use regex if 'input' in params and isinstance(params['input'], list):in the find field.

Quick find and replace for simple values. Can use regex in the find field.

note

Values that are not a number or a string pass through unaltered.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName or list of input column.string, integer, array—Yes
outputName or list of output column.string, array, nullnullNo
Options
findPattern to find using regex.string—Yes
replaceValue to replace the pattern found.string—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:
- replace:
input: Product Data
find: brg
replace: bearing
Product Data
SKF ball brg
brg seal
Product Data
SKF ball bearing
bearing seal
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID90
Catalog keyreplace
Recipe keyreplace
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.replace
Legacy UUIDf0ab715e-9e0e-4614-83e4-5cd8ea08a09f

Sources


Round​

Round column(s) to the specified decimals.

Round numbers in a column to the nearest decimal point of your choosing.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column(s).string, integer, array—Yes
outputName of the output column(s).string, array, nullnullNo
Formatting
decimalsNumber of decimal places to round column.integer0No
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:
- round:
input: Cost Per Unit
output: Cost Rounded
decimals: 2
Cost Per Unit
3.14159
2.71828
Cost Rounded
3.14
2.72
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID91
Catalog keyround
Recipe keyround
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.pandas.round
Legacy UUID12f3111b-8511-4e42-8d3f-b5302dc3b4e4

Sources


Translate​

Translate the input to a different language. Requires WrangleWorks Account and DeepL API Key (A free account for up to 500,000 characters per month is available).

Translate the input column to another language. Powered by DeepL.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the column to translate.string, integer, array—Yes
outputName of the output column.string, array—Yes
Options
target_languageCode of the language to translate to.string; one of:
  • Bulgarian
  • Chinese
  • Czech
  • Danish
  • Dutch
  • English (American)
  • English (British)
  • Estonian
  • Finnish
  • French
  • German
  • Greek
  • Hungarian
  • Italian
  • Japanese
  • Latvian
  • Lithuanian
  • Polish
  • Portuguese
  • Portuguese (Brazilian)
  • Romanian
  • Russian
  • Slovak
  • Slovenian
  • Spanish
  • Swedish
—Yes
source_languageCode of the language to translate from. If omitted, automatically detects the input language.string; one of:
  • Auto
  • Bulgarian
  • Chinese
  • Czech
  • Danish
  • Dutch
  • English
  • Estonian
  • Finnish
  • French
  • German
  • Greek
  • Hungarian
  • Italian
  • Japanese
  • Latvian
  • Lithuanian
  • Polish
  • Portuguese
  • Romanian
  • Russian
  • Slovak
  • Slovenian
  • Spanish
  • Swedish
"AUTO"No
caseAllow changing the case of the input prior to translation.string, 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:
- translate:
input: Español
output: English
source_language: Spanish
target_language: English (British)
Español
¡Hola Mundo!
English
Hello World!
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountYes
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID96
Catalog keytranslate
Recipe keytranslate
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.translate
Legacy UUID73c3ceb6-ffd8-4d74-8389-c83b99d33bb0

Sources


Standardize (Deprecated)​

Deprecated

This compatibility wrangle remains available for existing recipes. Use standardize.custom for new recipes.

Deprecated compatibility key for standardize.custom, which standardizes data using a trained DIY or bespoke model.

Run a standardize wrangle, such as one that expands abbreviations. A standardization wrangle must be trained first.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName or list of input columns.string, integer, array—Yes
outputName or list of output columns.string, array, nullnullNo
Options
case_sensitiveAllows the wrangle to be case sensitive if set to True, default is False.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
Details
model_idThe ID of the wrangle to use (do not include 'find' and 'replace').string, array—Yes

Examples​

wrangles:
- standardize:
input: Abbrev
output: Abbreviations
model_id: code_here
Abbrev
ASAP
ETA
Abbreviations
As Soon As Possible
Estimated Time of Arrival
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountYes
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID95
Catalog keystandardize
Recipe keystandardize
Catalog statusactive
Lifecycle statusdeprecated
Recipe Writer eligibleNo
Recipe Writer exclusionDeprecated compatibility key; use standardize.custom.
Replaced bystandardize.custom
NamespaceRoot-level
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.standardize
Legacy UUID53cd3fdd-24e2-4411-8655-6014b92a3f3a

Sources