W3cubDocs

/Nushell

dfr drop-nulls for dataframe

Drops null values in dataframe.

Signature

> dfr drop-nulls {flags} (subset)

Parameters

  • subset: subset of columns to drop nulls

Input/output types:

input output
any any

Examples

drop null values in dataframe

>letdf= ([[ab]; [12] [30] [12]] |dfr into-df);
letres= ($df.b/$df.b);
leta= ($df|dfr with-column$res--nameres);
$a|dfr drop-nulls
╭───┬───┬───┬─────╮
# │ a │ b │ res │
├───┼───┼───┼─────┤
0121
1121
╰───┴───┴───┴─────╯

drop null values in dataframe

>lets= ([120034] |dfr into-df);
    ($s/$s) |dfr drop-nulls
╭───┬─────────╮
# │ div_0_0 │
├───┼─────────┤
01
11
21
31
╰───┴─────────╯

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_drop-nulls.html