dfr dummies
for dataframe> dfr dummies {flags}
--drop-first, -d
: Drop first rowinput | output |
---|---|
any | any |
Create new dataframe with dummy variables from a dataframe
> [[ab]; [12] [34]] |dfr into-df|dfr dummies
╭───┬─────┬─────┬─────┬─────╮
│# │ a_1 │ a_3 │ b_2 │ b_4 │
├───┼─────┼─────┼─────┼─────┤
│0│1│0│1│0│
│1│0│1│0│1│
╰───┴─────┴─────┴─────┴─────╯
Create new dataframe with dummy variables from a series
> [12233] |dfr into-df|dfr dummies
╭───┬─────┬─────┬─────╮
│# │ 0_1 │ 0_2 │ 0_3 │
├───┼─────┼─────┼─────┤
│0│1│0│0│
│1│0│1│0│
│2│0│1│0│
│3│0│0│1│
│4│0│0│1│
╰───┴─────┴─────┴─────╯
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_dummies.html