polars.LazyFrame.merge_sorted#

LazyFrame.merge_sorted(other: LazyFrame, key: str) LDF[source]#

Take two sorted DataFrames and merge them by the sorted key.

The output of this operation will also be sorted. It is the callers responsibility that the frames are sorted by that key otherwise the output will not make sense.

The schemas of both LazyFrames must be equal.

Parameters:
other

Other DataFrame that must be merged

key

Key that is sorted.