Spec-Zone.ru › Nushell

polars drop-duplicates for dataframe

Drops duplicate values in dataframe.

Signature

> polars drop-duplicates {flags} (subset)

Flags

  • --maintain, -m: Maintain order.
  • --last, -l: Keeps last duplicate value (by default keeps first).

Parameters

  • subset: Subset of columns to drop duplicates.

Input/output types:

input output
polars_dataframe polars_dataframe
polars_lazyframe polars_lazyframe

Examples

drop duplicates

> [[a b]; [1 2] [3 4] [1 2]] | polars into-df
                | polars drop-duplicates
                | polars sort-by a
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 2 │
│ 1 │ 3 │ 4 │
╰───┴───┴───╯

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/polars_drop-duplicates.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API