DataFrame.rename
Change axis labels. Object values must be unique (1-to-1). Labels not contained in a dict / Series will be left as-is. Extra labels listed don’t throw an error.
danfo.DataFrame.rename(mapper, options)
Parameters | Type | Description | Default |
---|---|---|---|
mapper | Object | Labels and transformations to apply to that axis’ values. | |
options | Object | axis: row=0, columns=1. inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false | { axis : 1, inplace : false } |
Examples
Rename columns
By setting inplace to true, the original DataFrame is modified and nothing is returned. To not modify the original DataFrame and return a new one, set inplace to false or leave it as default.
Rename more the one column at time
Rename index by labels
Last updated