polars join-where

For lazyframe.

Joins a lazy frame with other lazy frame based on conditions.

warning This command requires a plugin The polars join-where command resides in the polars plugin. To use this command, you must install and register nu_plugin_polars. See the Plugins chapter in the book for more information.

Command Type

plugin

Signature

> polars join-where {flags} (other) (condition)

Parameters

  • other: LazyFrame to join with.
  • condition: Condition.

Input/output types:

input output
polars_dataframe polars_dataframe
polars_lazyframe polars_lazyframe

Examples

Join two lazy dataframes with a condition

> let df_a = ([[name cash];[Alice 5] [Bob 10]] | polars into-lazy)
    let df_b = ([[item price];[A 3] [B 7] [C 12]] | polars into-lazy)
    $df_a | polars join-where $df_b ((polars col cash) > (polars col price)) | polars collect
╭───┬───────┬──────┬──────┬───────╮
│ # │ name  │ cash │ item │ price │
├───┼───────┼──────┼──────┼───────┤
│ 0 │ Bob   │   10 │ B    │     7 │
│ 1 │ Bob   │   10 │ A    │     3 │
│ 2 │ Alice │    5 │ A    │     3 │
╰───┴───────┴──────┴──────┴───────╯

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.