W3cubDocs

/Nushell

dfr into-df for dataframe

Converts a list, table or record into a dataframe.

Signature

> dfr into-df {flags}

Input/output types:

input output
any any

Examples

Takes a dictionary and creates a dataframe

> [[ab];[12] [34]] |dfr into-df
╭───┬───┬───╮
# │ a │ b │
├───┼───┼───┤
012
134
╰───┴───┴───╯

Takes a list of tables and creates a dataframe

> [[12a] [34b] [56c]] |dfr into-df
╭───┬───┬───┬───╮
# │ 0 │ 1 │ 2 │
├───┼───┼───┼───┤
012a
134b
256c
╰───┴───┴───┴───╯

Takes a list and creates a dataframe

> [abc] |dfr into-df
╭───┬───╮
# │ 0 │
├───┼───┤
0a
1b
2c
╰───┴───╯

Takes a list of booleans and creates a dataframe

> [truetruefalse] |dfr into-df
╭───┬───────╮
# │   0   │
├───┼───────┤
0true
1true
2false
╰───┴───────╯

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_into-df.html