dfr join
for lazyframe> dfr join {flags} (other) (left_on) (right_on)
--inner, -i
: inner joing between lazyframes (default)--left, -l
: left join between lazyframes--outer, -o
: outer join between lazyframes--cross, -c
: cross join between lazyframes--suffix, -s {string}
: Suffix to use on columns with same nameother
: LazyFrame to join withleft_on
: Left column(s) to join onright_on
: Right column(s) to join oninput | output |
---|---|
any | any |
Join two lazy dataframes
>letdf_a= ([[abc];[1"a"0] [2"b"1] [1"c"2] [1"c"3]] |dfr into-lazy);
letdf_b= ([["foo""bar""ham"];[1"a""let"] [2"c""var"] [3"c""const"]] |dfr into-lazy);
$df_a|dfr join$df_bafoo|dfr collect
╭───┬───┬───┬───┬─────┬─────╮
│# │ a │ b │ c │ bar │ ham │
├───┼───┼───┼───┼─────┼─────┤
│0│1│a│0│a│let│
│1│2│b│1│c│var│
│2│1│c│2│a│let│
│3│1│c│3│a│let│
╰───┴───┴───┴───┴─────┴─────╯
Join one eager dataframe with a lazy dataframe
>letdf_a= ([[abc];[1"a"0] [2"b"1] [1"c"2] [1"c"3]] |dfr into-df);
letdf_b= ([["foo""bar""ham"];[1"a""let"] [2"c""var"] [3"c""const"]] |dfr into-lazy);
$df_a|dfr join$df_bafoo
╭───┬───┬───┬───┬─────┬─────╮
│# │ a │ b │ c │ bar │ ham │
├───┼───┼───┼───┼─────┼─────┤
│0│1│a│0│a│let│
│1│2│b│1│c│var│
│2│1│c│2│a│let│
│3│1│c│3│a│let│
╰───┴───┴───┴───┴─────┴─────╯
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_join.html