Skip to main content

Utilities

Wrangles that alter the data as a whole, leave data unchanged, or perform actions seen externally.

Accordion

Apply a series of wrangles to the individual elements of one or more lists.

Examples

Apply Convert Case to List Elements

This example applies convert.case to each string in a list, where the wrangle would not normally operate on the list as a whole.

Recipe
wrangles:
- accordion:
input: list_column
output: modified_lists
wrangles:
- convert.case:
input: list_column
output: modified_lists
case: upper
Input Sample
list_column
["a", "b", "c"]
["e", "f", "g"]
Output Sample
list_columnmodified_lists
["a", "b", "c"]["A", "B", "C"]
["e", "f", "g"]["E", "F", "G"]

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
inputInputlistYesColumn or columns containing the lists whose elements will be processed. Multiple list columns must contain matching element counts.
outputOutputlistYesColumns returned to the dataframe. Columns created inside the accordion are dropped unless listed here.
wranglesWranglesjsonYesWrangles to apply to each list element.
propagatePropagatelistNoLimit the columns available to the nested wrangles and replicated for each element. All columns are propagated when omitted.
whereWheretextNoFilter rows before applying the wrangle using SQL-style criteria.
where_paramsWhere ParamsjsonNoValues used to parameterize where with SQLite syntax such as ? or :name.
ifIftextNoCondition that determines whether the action runs as a whole.

Defaults

No defaults are documented in the legacy source.

Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities#accordion
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog SourceNot present in generated catalog
Mapping SourceNot present in generated mappings
Metadata
FieldValue
IDNot available in generated catalog
Wrangle Keyaccordion
Typeutility
Subtype
Variantstock
Statusactive (legacy documentation)
TagsUtility, accordion

Batch

Execute a series of wrangles in batches. Batches can run in parallel with threads and can provide fallback output when an error occurs.

Examples

Batch an Extract AI Wrangle

This example processes product descriptions in batches of two rows.

Recipe
wrangles:
- batch:
batch_size: 2
threads: 1
wrangles:
- extract.ai:
api_key: Your OpenAI API key
input: Product Description
output:
Title:
type: string
description: Title of the product
Input Sample
Product Description
Sleep better with our Memory Foam Pillow, designed to contour to your head and neck.
Stay comfortable and stylish with our Organic Cotton T-Shirt, made from soft, breathable fabric.
Keep drinks hot or cold with our Stainless Steel Water Bottle, featuring durable insulation.
Enjoy crisp sound and long battery life with our Wireless Bluetooth Earbuds.
Output Sample
Product DescriptionTitle
Sleep better with our Memory Foam Pillow, designed to contour to your head and neck.Memory Foam Pillow
Stay comfortable and stylish with our Organic Cotton T-Shirt, made from soft, breathable fabric.Organic Cotton T-Shirt
Keep drinks hot or cold with our Stainless Steel Water Bottle, featuring durable insulation.Stainless Steel Water Bottle
Enjoy crisp sound and long battery life with our Wireless Bluetooth Earbuds.Wireless Bluetooth Earbuds

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
batch_sizeBatch SizenumberYesNumber of rows in each batch.
wranglesWranglesjsonYesWrangles to apply to each batch as a nested recipe.
threadsThreadsnumberNoNumber of batches to run in parallel.
on_errorOn ErrorjsonNoDefault output to use when an error occurs within a batch.
ifIftextNoCondition that determines whether the action runs as a whole.

Defaults

No defaults are documented in the legacy source.

Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
note

Nested wrangles can have their own access or API-key requirements. The example uses extract.ai, which requires an API key.

Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities#batch
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog SourceNot present in generated catalog
Mapping SourceNot present in generated mappings
Metadata
FieldValue
IDNot available in generated catalog
Wrangle Keybatch
Typeutility
Subtype
Variantstock
Statusactive (legacy documentation)
TagsUtility, batch

Concurrent

Run multiple wrangles concurrently instead of sequentially. Concurrent wrangles must declare output columns, may finish in any order, and should not update overlapping columns.

See the Concurrent connector for the connector equivalent.

Examples

Run Extraction Wrangles Concurrently

Recipe
wrangles:
- concurrent:
wrangles:
- extract.codes:
input: Products
output: Part Codes
- extract.attributes:
input: Products
output: Attributes
Input Sample
Products
SKF ball brg 2" od 6202
brg seal 1" id 5493
3lb hammer 87102
Output Sample
ProductsPart CodesAttributes
SKF ball brg 2" od 62026202{"length":["2in"]}
brg seal 1" id 54935493{"length":["1in"]}
3lb hammer 8710287102{"weight":["3lb"]}

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
wranglesWranglesjsonYesWrangles to execute concurrently.
max_concurrencyMax ConcurrencynumberNoMaximum number of wrangles to execute in parallel.

Defaults

No defaults are documented in the legacy source.

Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
note

Nested wrangles can have their own access requirements.

Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities#concurrent
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog SourceNot present in generated catalog
Mapping SourceNot present in generated mappings
Metadata
FieldValue
IDNot available in generated catalog
Wrangle Keyconcurrent
Typeutility
Subtype
Variantstock
Statusactive (legacy documentation)
TagsUtility, concurrent

Copy

Create a copy of columns in a dataframe.

Examples

Copying a Column With Input and Output

Recipe
wrangles:
- copy:
input: Product Data
output: Product Data (copy)
Input Sample
Product Data
SKF ball brg
brg seal
Output Sample
Product DataProduct Data (copy)
SKF ball bearingSKF ball bearing
bearing sealbearing seal

Copying a Column Express as a Dictionary

Recipe
wrangles:
- copy:
Product Data: Product Data (copy)
Input Sample
Product Data
SKF ball brg
brg seal
Output Sample
Product DataProduct Data (copy)
SKF ball bearingSKF ball bearing
bearing sealbearing seal

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
inputInputlistYesThe column(s) to copy.["Column A", "Column B"]
outputOutputlistYesThe name of the output column(s).["Copy Output"]
whereWheretextNoFilter the data to only apply the wrangle to certain rows using SQL-style criteria, such as column1 = 123 OR column2 = 'abc'.
where_paramsWhere ParamsjsonNoVariables to use with where so the query can be parameterized. Uses SQLite syntax (? or :name).
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"input": [
"Column A",
"Column B"
],
"output": [
"Copy Output"
]
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
IDb002fbdc-92c0-4347-889d-0f4bfeec99fa
Wrangle Keycopy
Typetransform
Subtype
Variantstock
Statusactive
TagsTransform, copy

Drop

Drop (Delete) selected column(s)

Examples

Dropping a Column

Recipe
wrangles:
- drop:
columns:
- Material
Input Sample
MaterialProduct Data
CeramicSKF ball brg
Rubberbrg seal
Output Sample
Product Data
SKF ball bearing
bearing seal

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
columnsColumnslistYesName of the column(s) to drop["Column A", "Column B"]
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"columns": [
"Column A",
"Column B"
]
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
ID363bffbf-397e-4975-8382-e9efa5e9eed6
Wrangle Keydrop
Typeselect
Subtype
Variantstock
Statusactive
TagsSelect, drop

Explode

Explode a column of lists into rows

Examples

Exploding a Column

Recipe
wrangles:
- explode:
input: Products
Input Sample
ProductsManufacturer
[Ball Bearing, Bearing Seal]SKF
[Angle Grinder, Drill, Impact Driver]Milwaukee
Solid State RelaySchneider
Output Sample
ProductsManufacturer
Ball BearingSKF
Bearing SealSKF
Angle GrinderMilwaukee
DrillMilwaukee
Impact DriverMilwaukee
Solid State RelaySchneider

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
inputInputlistYesName of the column(s) to explode. If multiple columns are included, they must contain lists of the same length.["Column A", "Column B"]
drop_emptyDrop EmptybooleanNoEmpty lists will not produce a row in the exploded output. Default false.false
reset_indexReset IndexbooleanNoReset the index after exploding. Default false.false
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"input": [
"Column A",
"Column B"
],
"drop_empty": false,
"reset_index": false
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
ID4e4b13ac-8d50-4b2c-85c8-2c31de1e817d
Wrangle Keyexplode
Typesplit
Subtype
Variantstock
Statusactive
TagsSplit, explode

Filter

Filter the dataframe based on the contents.

Examples

Filtering a Column

Recipe
wrangles:
# Select only red fruits
- filter:
input: Color
equal:
- red
Input Sample
ColorFruit
redApple
greenApple
orangeOrange
redStrawberry
Output Sample
ColorFruit
redApple
redStrawberry

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
inputInputlistNoName of the column to filter on.["Column A", "Column B"]
betweenBetweenlistNoValue or list of values to filter that are in between two parameter values[]
containsContainstextNoSelect rows where the input contains the value. Allows regular expressions.""
equalEqualbooleanNoSelect rows where the values equal a given value.false
greater_thanGreater ThannumberNoSelect rows where the values are greater than a specified value. Does include the value itself.""
greater_than_equal_toGreater Than Equal TonumberNoSelect rows where the values are greater than a specified value. Does include the value itself.""
is_inIs InlistNoSelect rows where the values are in a given list.[]
is_nullIs NullbooleanNoIf true, select all rows where the value is NULL. If false, where is not NULL.false
less_thanLess ThannumberNoSelect rows where the values are less than a specified value. Does not include the value itself.""
less_than_equal_toLess Than Equal TonumberNoSelect rows where the values are less than a specified value. Does include the value itself.""
not_containsNot ContainstextNoSelect rows where the input does not contain the value. Allows regular expressions.""
not_equalNot EqualbooleanNoSelect rows where the values do not equal a given value.false
not_inNot InlistNoSelect rows where the values are not in a given list.[]
whereWheretextNoUse a SQL WHERE clause to filter the data. input must be used if where is not provided. Prefer using where independently of all other parameters except where_params.""
where_paramsWhere ParamsjsonNoVariables to use with where so the query can be parameterized. Uses SQLite syntax (? or :name).[]
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"equal": false,
"input": [
"Column A",
"Column B"
],
"is_in": [],
"not_in": [],
"between": [],
"is_null": false,
"contains": "",
"less_than": "",
"not_equal": false,
"greater_than": "",
"not_contains": "",
"less_than_equal_to": "",
"greater_than_equal_to": ""
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
IDe3242acf-d204-433f-8373-205b77481131
Wrangle Keyfilter
Typeselect
Subtype
Variantstock
Statusactive
TagsSelect, filter

Log

Print the current status of the dataframe. Only a sample of rows is logged.

Examples

Logging All Columns to Terminal

Recipe
wrangles:
- log: {}
Input Sample

Logging side-effect; no tabular input sample.

Output Sample

Logs a sample of rows or status information to the configured destination.

Logging Specific Columns to Terminal

Recipe
wrangles:
- log:
columns:
- column1
- column2
Input Sample

Logging side-effect; no tabular input sample.

Output Sample

Logs a sample of rows or status information to the configured destination.

Logging to a File

Recipe
wrangles:
- log:
write:
- file:
name: output/filepath
columns:
- column 1
- column 2
Input Sample

Logging side-effect; no tabular input sample.

Output Sample

Logs a sample of rows or status information to the configured destination.

Native Variables

VariableFunction
${column_count}Number of columns.
${columns}List of all columns.
${df}Current dataframe.
${row_count}Number of visible rows processed in each batch.

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
columnsColumnslistNoList of specific columns to log. Defaults to all columns.["Column A", "Column B"]
writeWritelistNoAllows an intermediate output to a file, dataframe, database, etc.[]
errorErrortextNoLog an error to the console.""
warningWarningtextNoLog a warning to the console.""
infoInfotextNoLog info to the console.""
log_dataLog DatabooleanNoWhether to log a sample of the dataframe contents. Default true.false
whereWheretextNoFilter the data to only apply the wrangle to certain rows using SQL-style criteria, such as column1 = 123 OR column2 = 'abc'.
where_paramsWhere ParamsjsonNoVariables to use with where so the query can be parameterized. Uses SQLite syntax (? or :name).
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"info": "",
"error": "",
"write": [],
"columns": [
"Column A",
"Column B"
],
"warning": "",
"log_data": false
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
ID6177808e-aa2d-4d0b-8385-858b16948a5d
Wrangle Keylog
Typeutility
Subtype
Variantstock
Statusactive
TagsUtility, log

Matrix

Apply a matrix of wrangles to the dataframe. Each wrangle runs for the configured combinations of variables, including recipe variables and variables declared by the variables parameter.

See the Matrix connector for the connector equivalent.

Examples

Use Hardcoded Variables

Run a custom function once for each configured variable value.

Recipe
wrangles:
- matrix:
variables:
var: [A, B, C]
wrangles:
- custom.test_fn:
input: Part Code
output: Part Code ${var}
value: ${var}
def test_fn(part_code, value):
return part_code + value
Input Sample
Part Code
6202
br549
554-114
554-112
Output Sample
Part CodePart Code APart Code BPart Code C
62026202A6202B6202C
br549br549Abr549Bbr549C
554-114554-114A554-114B554-114C
554-112554-112A554-112B554-112C

Use Unique Variables Per Row

This example runs extract.custom once for each unique model ID.

Recipe
wrangles:
- matrix:
variables:
model_id: set(Model ID)
wrangles:
- extract.custom:
input: Description
output: Extracted Values
model_id: ${model_id}
where: "[Model ID] = ?"
where_params:
- ${model_id}
Input Sample
DescriptionModel ID
The SKF 6202 bearing is the best bearing in the worldxxxxxxxx-xxxx-xxxx
The Timken 6102 bearing is indestructibleyyyyyyyy-yyyy-yyyy
The Milwaukee impact has 1200ft-lbs of torquezzzzzzzz-zzzz-zzzz
Output Sample
DescriptionModel IDExtracted Values
The SKF 6202 bearing is the best bearing in the worldxxxxxxxx-xxxx-xxxx6202
The Timken 6102 bearing is indestructibleyyyyyyyy-yyyy-yyyyindestructible
The Milwaukee impact has 1200ft-lbs of torquezzzzzzzz-zzzz-zzzz1200ft-lbs

Native Variables

VariableFunction
${column_count}Number of columns.
${columns}List of all columns.
${df}Current dataframe.
${row_count}Number of visible rows processed in each batch.

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
variablesVariablesjsonYesVariable names and the values passed to nested wrangles.
wranglesWranglesjsonYesWrangles to run for each variable combination.
functionsFunctionsjsonNoUser-defined custom functions available to nested wrangles.
strategyStrategyselectNoHow multiple variables are combined. loop repeats shorter lists until the longest completes; permutations uses every combination.loop, permutationsloop
ifIftextNoCondition that determines whether the action runs as a whole.

Defaults

{
"strategy": "loop"
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
note

Nested wrangles can have their own access requirements.

Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities#matrix
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog SourceNot present in generated catalog
Mapping SourceNot present in generated mappings
Metadata
FieldValue
IDNot available in generated catalog
Wrangle Keymatrix
Typeutility
Subtype
Variantstock
Statusactive (legacy documentation)
TagsUtility, matrix

Reindex

Conform a DataFrame to a new index with optional filling logic.

Examples

note

Cannot specify both axis and any of index or columns. Reindex is not compatible with where filtering.

Reindexing a Dataframe

Recipe
wrangles:
- reindex:
index:
- 5
- 4
- 3
- 2
- 1
Input Sample
MaterialProduct Data
1CeramicSKF ball brg
2Rubberbrg seal
3BrassBall valve
4CeramicCeramic cartridge
5Stainless SteelNeedle Bearing
Output Sample
MaterialProduct Data
5Stainless SteelNeedle Bearing
4CeramicCeramic cartridge
3BrassBall valve
2Rubberbrg seal
1CeramicSKF ball brg

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
columnsColumnslistNoNew labels for the columns. Preferably an Index object to avoid duplicating data.["Column A", "Column B"]
axisAxistextNoAxis to target. Can be either the axis name (‘index’, ‘columns’) or number (0, 1).""
indexIndexlistNoNew labels for the index. Preferably an Index object to avoid duplicating data.[]
labelsLabelslistNoNew labels / index to conform the axis specified by axis.[]
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"axis": "",
"index": [],
"labels": [],
"columns": [
"Column A",
"Column B"
]
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
IDdef87df8-72da-4e34-83c1-1fde25126257
Wrangle Keyreindex
Typetransform
Subtype
Variantstock
Statusactive
TagsTransform, reindex

Rename

Rename a column or list of columns.

Examples

note

Rename is not compatible with where filtering.

Renaming Columns With Input and Output

Recipe
wrangles:
- rename:
input:
- Manufacturer Name
- Manufacturer Part Number
output:
- Manufacturer
- MPN
Input Sample
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
Output Sample
ManufacturerMPN
SKF302-2
TimkenPF48

Renaming Columns Without Using Input and Output

Recipe
wrangles:
- rename:
Manufacturer Name: Manufacturer
Manufacturer Part Number: MPN
Input Sample
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
Output Sample
ManufacturerMPN
SKF302-2
TimkenPF48

Using Wrangles in Rename

Recipe
wrangles:
- rename:
wrangles:
- convert.case:
input: columns
case: upper
Input Sample
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
Output Sample
MANUFACTURER NAMEMANUFACTURER PART NUMBER
SKF302-2
TimkenPF48

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
inputInputlistNoName or list of input columns.["Column A", "Column B"]
outputOutputlistNoName or list of output columns.["Rename Output"]
wranglesWrangleslistNoUse wrangles to transform the column names. The input is named columns and the final result must also include the column named columns. This can only be used instead of the standard rename.[]
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"input": [
"Column A",
"Column B"
],
"output": [
"Rename Output"
],
"wrangles": []
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
IDab06898f-faf7-42e7-8275-5e3034a4d727
Wrangle Keyrename
Typetransform
Subtype
Variantstock
Statusactive
TagsTransform, rename

Sort

Sort the data

Examples

Replacing Abbreviations

Recipe
wrangles:
- sort:
by: Price
ascending: true
Input Sample
ItemPrice
Hammer11.99
Chisel4.99
Drill29.99
Wrench6.99
Saw13.99
Output Sample
ItemPrice
Chisel4.99
Wrench6.99
Hammer11.99
Saw13.99
Drill29.99

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
byBylistYesName or list of the column(s) to sort by["Column A", "Column B"]
ascendingAscendingbooleanNoSort ascending vs. descending. Specify a list to sort multiple columns in different orders. If this is a list of bools then it must match the length of the by.false
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"by": [
"Column A",
"Column B"
],
"ascending": false
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
ID1dcf06ad-898a-4d83-862c-4774be37a687
Wrangle Keysort
Typeselect
Subtype
Variantstock
Statusactive
TagsSelect, sort

Transpose

Transpose a dataframe.

Examples

note

Transpose is not compatible with where filtering.

Transposing a Dataframe

Recipe
wrangles:
- transpose:
header_column: Material
Input Sample
MaterialProduct Data
CeramicSKF ball brg
Rubberbrg seal
Output Sample
MaterialCeramicRubber
Product DataSKF ball brgbrg seal

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
header_columnHeader ColumntextNoName or position of the column that will be used as the column headings for the transposed DataFrame. Default 0 (first column). Use header_column = null to not use any column as header.""
ifIftextNoA condition that determines whether the action runs as a whole.

Defaults

{
"header_column": ""
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleCatalog.generated.js
Mapping Sourcemy-docs-site/src/components/WrangleFlowPlayground/wrangleMappings.json
Metadata
FieldValue
ID8716347f-f286-49b2-8a0b-cb73292e7475
Wrangle Keytranspose
Typetransform
Subtype
Variantstock
Statusactive
TagsTransform, transpose

Try

Run a list of wrangles and catch errors. When except is provided, its wrangles or fallback column values run after an error; otherwise, the error is logged and the recipe continues.

Examples

Use Fallback Wrangles After an Error

Recipe
wrangles:
- try:
wrangles:
- risky_wrangle:
input: column
except:
- backup_wrangle:
input: column
Input Sample

The input dataframe is passed to the primary wrangles.

Output Sample

The primary result is returned on success; the except result is returned after an error.

Parameters

ParameterLabelUI TypeRequiredDescriptionAllowed ValuesDefault
dfDataframejsonYesDataframe supplied to the nested wrangles by the recipe runtime.
wranglesWranglesjsonYesPrimary wrangles to apply.
exceptExceptjsonNoWrangles or column/value fallbacks used after an error. When omitted, the error is logged and execution continues.
functionsFunctionsjsonNoUser-defined custom functions available to the nested wrangles.
variablesVariablesjsonNoVariables available to the nested wrangles.
retriesRetriesnumberNoNumber of times to retry after an error.0
ifIftextNoCondition that determines whether the action runs as a whole.

Defaults

{
"retries": 0
}
Access
RequirementValue
AI-backedNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
note

Nested wrangles can have their own access requirements.

Source
FieldValue
Docs Pathdocs/python/recipes/wrangles/utilities.md
Docs URLhttps://wrangles.io/python/recipes/wrangles/utilities#try
Legacy Pathdocs/python/recipes/wrangles/utilities.md
Catalog SourceNot present in generated catalog
Mapping SourceNot present in generated mappings
Metadata
FieldValue
IDNot available in generated catalog
Wrangle Keytry
Typeutility
Subtype
Variantstock
Statusactive (legacy documentation)
TagsUtility, try

Metadata

FieldValue
Typeutility compatibility page
Wrangle Count14
Generated Sourcepublic.wranglesio_content plus retained legacy Utilities documentation
Section SourcesShared partials from wrangle-docs/utility, transform, select, and split