diff --git a/crates/polars-plan/src/dsl/mod.rs b/crates/polars-plan/src/dsl/mod.rs index cdcfd2ecf7f64..a38b7b2d200ec 100644 --- a/crates/polars-plan/src/dsl/mod.rs +++ b/crates/polars-plan/src/dsl/mod.rs @@ -437,6 +437,8 @@ impl Expr { } /// Returns the `k` largest rows by given column. + /// + /// For single column, use [`Expr::top_k`]. #[cfg(feature = "top_k")] pub fn top_k_by, E: AsRef<[IE]>, IE: Into + Clone, G: AsRef<[bool]>>( self, @@ -459,7 +461,9 @@ impl Expr { self.apply_many_private(FunctionExpr::TopK(true), &[k], false, false) } - /// Returns the `k` largest rows by given column. + /// Returns the `k` smallest rows by given column. + /// + /// For single column, use [`Expr::bottom_k`]. #[cfg(feature = "top_k")] pub fn bottom_k_by, E: AsRef<[IE]>, IE: Into + Clone, G: AsRef<[bool]>>( self,