From d5f54726a430add6a816afc01be7a1a14a930106 Mon Sep 17 00:00:00 2001 From: Henry Harbeck Date: Sun, 7 Apr 2024 22:15:47 +1000 Subject: [PATCH] update references from `by` to `group_by` --- py-polars/polars/dataframe/frame.py | 20 ++++++++++---------- py-polars/polars/lazyframe/frame.py | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index 1d6ebae09259..0f95beef18e9 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -5464,8 +5464,8 @@ def rolling( index_column Column used to group based on the time window. Often of type Date/Datetime. - This column must be sorted in ascending order (or, if `by` is specified, - then it must be sorted in ascending order within each group). + This column must be sorted in ascending order (or, if `group_by` is + specified, then it must be sorted in ascending order within each group). In case of a rolling operation on indices, dtype needs to be one of {UInt32, UInt64, Int32, Int64}. Note that the first three get temporarily @@ -5491,8 +5491,8 @@ def rolling( ------- RollingGroupBy Object you can call `.agg` on to aggregate by groups, the result - of which will be sorted by `index_column` (but note that if `by` columns are - passed, it will only be sorted within each `by` group). + of which will be sorted by `index_column` (but note that if `group_by` + columns are passed, it will only be sorted within each group). See Also -------- @@ -5580,7 +5580,7 @@ def group_by_dynamic( datapoint. See the `start_by` argument description for details. .. warning:: - The index column must be sorted in ascending order. If `by` is passed, then + The index column must be sorted in ascending order. If `group_by` is passed, then the index column must be sorted in ascending order within each group. Parameters @@ -5588,7 +5588,7 @@ def group_by_dynamic( index_column Column used to group based on the time window. Often of type Date/Datetime. - This column must be sorted in ascending order (or, if `by` is specified, + This column must be sorted in ascending order (or, if `group_by` is specified, then it must be sorted in ascending order within each group). In case of a dynamic group by on indices, dtype needs to be one of @@ -5651,8 +5651,8 @@ def group_by_dynamic( ------- DynamicGroupBy Object you can call `.agg` on to aggregate by groups, the result - of which will be sorted by `index_column` (but note that if `by` columns are - passed, it will only be sorted within each `by` group). + of which will be sorted by `index_column` (but note that if `group_by` columns are + passed, it will only be sorted within each group). See Also -------- @@ -5942,8 +5942,8 @@ def upsample( Returns ------- DataFrame - Result will be sorted by `time_column` (but note that if `by` columns are - passed, it will only be sorted within each `by` group). + Result will be sorted by `time_column` (but note that if `group_by` columns + are passed, it will only be sorted within each group). Examples -------- diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index cbbff5bcf75b..105545a8cfc6 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -3242,7 +3242,7 @@ def rolling( """ Create rolling groups based on a temporal or integer column. - Different from a `dynamic_group_by` the windows are now determined by the + Different from a `group_by_dynamic` the windows are now determined by the individual values and are not of constant intervals. For constant intervals use :func:`LazyFrame.group_by_dynamic`. @@ -3289,8 +3289,8 @@ def rolling( index_column Column used to group based on the time window. Often of type Date/Datetime. - This column must be sorted in ascending order (or, if `by` is specified, - then it must be sorted in ascending order within each group). + This column must be sorted in ascending order (or, if `group_by` is + specified, then it must be sorted in ascending order within each group). In case of a rolling group by on indices, dtype needs to be one of {UInt32, UInt64, Int32, Int64}. Note that the first three get temporarily @@ -3316,8 +3316,8 @@ def rolling( ------- LazyGroupBy Object you can call `.agg` on to aggregate by groups, the result - of which will be sorted by `index_column` (but note that if `by` columns are - passed, it will only be sorted within each `by` group). + of which will be sorted by `index_column` (but note that if `group_by` + columns are passed, it will only be sorted within each group). See Also -------- @@ -3409,7 +3409,7 @@ def group_by_dynamic( datapoint. See the `start_by` argument description for details. .. warning:: - The index column must be sorted in ascending order. If `by` is passed, then + The index column must be sorted in ascending order. If `group_by` is passed, then the index column must be sorted in ascending order within each group. Parameters @@ -3417,7 +3417,7 @@ def group_by_dynamic( index_column Column used to group based on the time window. Often of type Date/Datetime. - This column must be sorted in ascending order (or, if `by` is specified, + This column must be sorted in ascending order (or, if `group_by` is specified, then it must be sorted in ascending order within each group). In case of a dynamic group by on indices, dtype needs to be one of @@ -3480,8 +3480,8 @@ def group_by_dynamic( ------- LazyGroupBy Object you can call `.agg` on to aggregate by groups, the result - of which will be sorted by `index_column` (but note that if `by` columns are - passed, it will only be sorted within each `by` group). + of which will be sorted by `index_column` (but note that if `group_by` columns are + passed, it will only be sorted within each group). See Also --------