polars str-join for dataframe
Concatenates strings within a column or dataframes
Signature
> polars str-join {flags} (other)
Flags
-
--delimiter, -d {string}: Delimiter to join strings within an expression. Other dataframe when used with a dataframe. -
--ignore-nulls, -n: Ignore null values. Only available when used as an expression.
Parameters
-
other: Other dataframe with a single series of strings to be concatenated. Required when used with a dataframe, ignored when used as an expression.
Input/output types:
| input | output |
|---|---|
| polars_expression | polars_expression |
| polars_dataframe | polars_dataframe |
| polars_lazyframe | polars_lazyframe |
Examples
Join strings in a column
> [[a]; [abc] [abc] [abc]] | polars into-df | polars select (polars col a | polars str-join -d ',') | polars collect ╭───┬─────────────╮ │ # │ a │ ├───┼─────────────┤ │ 0 │ abc,abc,abc │ ╰───┴─────────────╯
StrJoin strings across two series
> let other = ([za xs cd] | polars into-df);
[abc abc abc] | polars into-df | polars str-join $other
╭───┬───────╮
│ # │ 0 │
├───┼───────┤
│ 0 │ abcza │
│ 1 │ abcxs │
│ 2 │ abccd │
╰───┴───────╯
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/polars_str-join.html