W3cubDocs

/Nushell

dfr first for dataframe

Show only the first number of rows or create a first expression

Signature

> dfr first {flags} (rows)

Parameters

  • rows: starting from the front, the number of rows to return

Input/output types:

input output
any any

Examples

Return the first row of a dataframe

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

Return the first two rows of a dataframe

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

Creates a first expression from a column

>dfr cola|dfr first

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_first.html