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