Skip to main content

Transform Wrangles

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

Copy​

Make a copy of a column or a list of columns.

Create a copy of columns in a dataframe.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input columns or columns.string, integer, array, nullnullNo
outputName of the output columns or columns.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:
- copy:
input: Product Data
output: Product Data (copy)
Product Data
SKF ball brg
brg seal
Product DataProduct Data (copy)
SKF ball bearingSKF ball bearing
bearing sealbearing seal
wrangles:
- copy:
Product Data: Product Data (copy)
Product Data
SKF ball brg
brg seal
Product DataProduct Data (copy)
SKF ball bearingSKF ball bearing
bearing sealbearing seal
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID74
Catalog keycopy
Recipe keycopy
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation grouptransform
AliasesNone
Runtime symbolwrangles.recipe_wrangles.pandas.copy
Legacy UUIDb002fbdc-92c0-4347-889d-0f4bfeec99fa

Sources


Reindex​

Changes the row labels and column labels of a DataFrame.

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

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
columnsNew labels for the columns. Preferably an Index object to avoid duplicating data.array, nullnullNo
Options
labelsNew labels / index to conform the axis specified by ‘axis’ to.array, nullnullNo
indexNew labels for the index. Preferably an Index object to avoid duplicating data.array, nullnullNo
axisAxis to target. Can be either the axis name (‘index’, ‘columns’) or number (0, 1).string, integer, nullnullNo
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No

Examples​

note

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

wrangles:
- reindex:
index:
- 5
- 4
- 3
- 2
- 1
MaterialProduct Data
1CeramicSKF ball brg
2Rubberbrg seal
3BrassBall valve
4CeramicCeramic cartridge
5Stainless SteelNeedle Bearing
MaterialProduct Data
5Stainless SteelNeedle Bearing
4CeramicCeramic cartridge
3BrassBall valve
2Rubberbrg seal
1CeramicSKF ball brg
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID87
Catalog keyreindex
Recipe keyreindex
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation grouptransform
AliasesNone
Runtime symbolwrangles.recipe_wrangles.pandas.reindex
Legacy UUIDdef87df8-72da-4e34-83c1-1fde25126257

Sources


Rename​

Rename a column or list of columns.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName or list of input columns.string, integer, array, nullnullNo
outputName or list of output columns.string, array, nullnullNo
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
Execution
wranglesUse 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.array, nullnullNo

Examples​

note

Rename is not compatible with where filtering.

wrangles:
- rename:
input:
- Manufacturer Name
- Manufacturer Part Number
output:
- Manufacturer
- MPN
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
ManufacturerMPN
SKF302-2
TimkenPF48
wrangles:
- rename:
Manufacturer Name: Manufacturer
Manufacturer Part Number: MPN
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
ManufacturerMPN
SKF302-2
TimkenPF48
wrangles:
- rename:
wrangles:
- convert.case:
input: columns
case: upper
Manufacturer NameManufacturer Part Number
SKF302-2
TimkenPF48
MANUFACTURER NAMEMANUFACTURER PART NUMBER
SKF302-2
TimkenPF48
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID89
Catalog keyrename
Recipe keyrename
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleNo
Recipe Writer exclusionStructural rename steps are not supported in the baseline.
NamespaceRoot-level
Documentation grouptransform
AliasesNone
Runtime symbolwrangles.recipe_wrangles.main.rename
Legacy UUIDab06898f-faf7-42e7-8275-5e3034a4d727

Sources


Transpose​

Transpose the DataFrame (swap columns to rows).

Transpose a dataframe.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
header_columnName 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.string, integer, null0No
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​

note

Transpose is not compatible with where filtering.

wrangles:
- transpose:
header_column: Material
MaterialProduct Data
CeramicSKF ball brg
Rubberbrg seal
MaterialCeramicRubber
Product DataSKF ball brgbrg seal
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID97
Catalog keytranspose
Recipe keytranspose
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
NamespaceRoot-level
Documentation grouptransform
AliasesNone
Runtime symbolwrangles.recipe_wrangles.pandas.transpose
Legacy UUID8716347f-f286-49b2-8a0b-cb73292e7475

Sources