dfr rename
for dataframe or lazyframe> dfr rename {flags} (columns) (new names)
columns
: Column(s) to be renamed. A string or list of stringsnew names
: New names for the selected column(s). A string or list of stringsinput | output |
---|---|
any | any |
Renames a series
> [5678] |dfr into-df|dfr rename'0'new_name
╭───┬──────────╮
│# │ new_name │
├───┼──────────┤
│0│5│
│1│6│
│2│7│
│3│8│
╰───┴──────────╯
Renames a dataframe column
> [[ab]; [12] [34]] |dfr into-df|dfr renameaa_new
╭───┬───────┬───╮
│# │ a_new │ b │
├───┼───────┼───┤
│0│1│2│
│1│3│4│
╰───┴───────┴───╯
Renames two dataframe columns
> [[ab]; [12] [34]] |dfr into-df|dfr rename [ab] [a_newb_new]
╭───┬───────┬───────╮
│# │ a_new │ b_new │
├───┼───────┼───────┤
│0│1│2│
│1│3│4│
╰───┴───────┴───────╯
Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe
flag
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/dfr_rename.html