Skip to main content

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