polars is-in
for expression
Creates an is-in expression or checks to see if the elements are contained in the right series
This command requires a plugin
The polars is-in
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.
Signature
> polars is-in {flags} (list)
Parameters
list
: List to check if values are in
Input/output types:
input | output |
---|---|
expression | expression |
Examples
Creates a is-in expression
> let df = ([[a b]; [one 1] [two 2] [three 3]] | polars into-df);
$df | polars with-column (polars col a | polars is-in [one two] | polars as a_in)
╭───┬───────┬───┬───────╮
│ # │ a │ b │ a_in │
├───┼───────┼───┼───────┤
│ 0 │ one │ 1 │ true │
│ 1 │ two │ 2 │ true │
│ 2 │ three │ 3 │ false │
╰───┴───────┴───┴───────╯