dfr explode
for lazyframe> dfr explode {flags} ...rest
...rest
: columns to explode, only applicable for dataframesinput | output |
---|---|
any | any |
Explode the specified dataframe
> [[idnamehobbies]; [1Mercy [CyclingKnitting]] [2Bob [SkiingFootball]]] |dfr into-df|dfr explodehobbies|dfr collect
╭───┬────┬───────┬──────────╮
│# │ id │ name │ hobbies │
├───┼────┼───────┼──────────┤
│0│1│Mercy│Cycling│
│1│1│Mercy│Knitting│
│2│2│Bob│Skiing│
│3│2│Bob│Football│
╰───┴────┴───────┴──────────╯
Select a column and explode the values
> [[idnamehobbies]; [1Mercy [CyclingKnitting]] [2Bob [SkiingFootball]]] |dfr into-df|dfr select (dfr colhobbies|dfr explode)
╭───┬──────────╮
│# │ hobbies │
├───┼──────────┤
│0│Cycling│
│1│Knitting│
│2│Skiing│
│3│Football│
╰───┴──────────╯
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_explode.html