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
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name of the input columns or columns. | string, integer, array, null | null | No |
output | Name of the output columns or columns. | string, array, null | null | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values 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 Data | Product Data (copy) |
|---|---|
| SKF ball bearing | SKF ball bearing |
| bearing seal | bearing seal |
wrangles:
- copy:
Product Data: Product Data (copy)
| Product Data |
|---|
| SKF ball brg |
| brg seal |
| Product Data | Product Data (copy) |
|---|---|
| SKF ball bearing | SKF ball bearing |
| bearing seal | bearing seal |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 74 |
| Catalog key | copy |
| Recipe key | copy |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | Root-level |
| Documentation group | transform |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.pandas.copy |
| Legacy UUID | b002fbdc-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
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
columns | New labels for the columns. Preferably an Index object to avoid duplicating data. | array, null | null | No |
| Options | ||||
labels | New labels / index to conform the axis specified by ‘axis’ to. | array, null | null | No |
index | New labels for the index. Preferably an Index object to avoid duplicating data. | array, null | null | No |
axis | Axis to target. Can be either the axis name (‘index’, ‘columns’) or number (0, 1). | string, integer, null | null | No |
| Conditions | ||||
if | Condition 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
| Material | Product Data | |
|---|---|---|
| 1 | Ceramic | SKF ball brg |
| 2 | Rubber | brg seal |
| 3 | Brass | Ball valve |
| 4 | Ceramic | Ceramic cartridge |
| 5 | Stainless Steel | Needle Bearing |
| Material | Product Data | |
|---|---|---|
| 5 | Stainless Steel | Needle Bearing |
| 4 | Ceramic | Ceramic cartridge |
| 3 | Brass | Ball valve |
| 2 | Rubber | brg seal |
| 1 | Ceramic | SKF ball brg |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 87 |
| Catalog key | reindex |
| Recipe key | reindex |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | Root-level |
| Documentation group | transform |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.pandas.reindex |
| Legacy UUID | def87df8-72da-4e34-83c1-1fde25126257 |
Sources
Rename
Rename a column or list of columns.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name or list of input columns. | string, integer, array, null | null | No |
output | Name or list of output columns. | string, array, null | null | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
| Execution | ||||
wrangles | Use 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, null | null | No |
Examples
note
Rename is not compatible with where filtering.
wrangles:
- rename:
input:
- Manufacturer Name
- Manufacturer Part Number
output:
- Manufacturer
- MPN
| Manufacturer Name | Manufacturer Part Number |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
| Manufacturer | MPN |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
wrangles:
- rename:
Manufacturer Name: Manufacturer
Manufacturer Part Number: MPN
| Manufacturer Name | Manufacturer Part Number |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
| Manufacturer | MPN |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
wrangles:
- rename:
wrangles:
- convert.case:
input: columns
case: upper
| Manufacturer Name | Manufacturer Part Number |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
| MANUFACTURER NAME | MANUFACTURER PART NUMBER |
|---|---|
| SKF | 302-2 |
| Timken | PF48 |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 89 |
| Catalog key | rename |
| Recipe key | rename |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | No |
| Recipe Writer exclusion | Structural rename steps are not supported in the baseline. |
| Namespace | Root-level |
| Documentation group | transform |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.main.rename |
| Legacy UUID | ab06898f-faf7-42e7-8275-5e3034a4d727 |
Sources
Transpose
Transpose the DataFrame (swap columns to rows).
Transpose a dataframe.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
header_column | Name 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, null | 0 | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values 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
| Material | Product Data |
|---|---|
| Ceramic | SKF ball brg |
| Rubber | brg seal |
| Material | Ceramic | Rubber |
|---|---|---|
| Product Data | SKF ball brg | brg seal |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 97 |
| Catalog key | transpose |
| Recipe key | transpose |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | Root-level |
| Documentation group | transform |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.pandas.transpose |
| Legacy UUID | 8716347f-f286-49b2-8a0b-cb73292e7475 |
Sources