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: Update pivot docstring for clarity #18000

Merged
merged 3 commits into from
Aug 5, 2024
Merged
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
16 changes: 9 additions & 7 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7796,16 +7796,18 @@ def pivot(
Parameters
----------
on
Name of the column(s) whose values will be used as the header of the output
The column(s) whose values will be used as the new columns of the output
DataFrame.
index
One or multiple keys to group by. If None, all remaining columns not specified
on `on` and `values` will be used. At least one of `index` and `values` must
be specified.
The column(s) that remain from the input to the output. The output DataFrame will have one row
for each unique combination of the `index`'s values.
If None, all remaining columns not specified on `on` and `values` will be used. At least one
of `index` and `values` must be specified.
values
One or multiple keys to group by. If None, all remaining columns not specified
on `on` and `index` will be used. At least one of `index` and `values` must
be specified.
The existing column(s) of values which will be moved under the new columns from index. If an
aggregation is specified, these are the values on which the aggregation will be computed.
If None, all remaining columns not specified on `on` and `index` will be used.
At least one of `index` and `values` must be specified.
aggregate_function
Choose from:

Expand Down