Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(python): Update leftover references of by parameter to group_by in DataFrame/LazyFrame.upsample/group_by_dynamic/rolling #15527

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the by in "...within each by group)." isn't needed anymore.
The group_by parameter name makes it very obvious what the group is.


See Also
--------
Expand Down Expand Up @@ -5580,15 +5580,15 @@ 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
----------
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
Expand Down Expand Up @@ -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
--------
Expand Down Expand Up @@ -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
--------
Expand Down
18 changes: 9 additions & 9 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by typo fix. Now aligns with DataFrame docstring.

individual values and are not of constant intervals. For constant intervals
use :func:`LazyFrame.group_by_dynamic`.

Expand Down Expand Up @@ -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
Expand All @@ -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
--------
Expand Down Expand Up @@ -3409,15 +3409,15 @@ 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
----------
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
Expand Down Expand Up @@ -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
--------
Expand Down
Loading