polars.LazyFrame.unique#

LazyFrame.unique(maintain_order: bool = True, subset: str | list[str] | None = None, keep: UniqueKeepStrategy = 'first') LDF[source]#

Drop duplicate rows from this DataFrame.

Note that this fails if there is a column of type List in the DataFrame or subset.

Parameters:
maintain_order

Keep the same order as the original DataFrame. This requires more work to compute.

subset

Subset to use to compare rows.

keep{‘first’, ‘last’}

Which of the duplicate rows to keep.

Returns:
DataFrame with unique rows