Skip to content

Commit

Permalink
more reordering and fixup rust test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jun 21, 2024
1 parent d6bfd56 commit 2df04e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/polars/tests/it/core/pivot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ fn test_pivot_old() {
);
let pvt = pivot(
&df,
["index"],
["columns"],
["index"],
Some(["values"]),
false,
Some(PivotAgg::Count),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/python/user-guide/transformations/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# --8<-- [end:df]

# --8<-- [start:eager]
out = df.pivot(index="foo", on="bar", values="N", aggregate_function="first")
out = df.pivot("bar", index="foo", values="N", aggregate_function="first")
print(out)
# --8<-- [end:eager]

Expand Down
6 changes: 3 additions & 3 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7609,10 +7609,10 @@ def pivot(
on
Name of the column(s) whose values will be used as the header of the output
DataFrame.
values
Column values to aggregate. If None, all remaining columns will be used.
index
One or multiple keys to group by.
values
Column values to aggregate. If None, all remaining columns will be used.
aggregate_function
Choose from:
Expand Down Expand Up @@ -7644,7 +7644,7 @@ def pivot(
... "baz": [1, 2, 3, 4, 5, 6],
... }
... )
>>> df.pivot(index="foo", on="bar", values="baz", aggregate_function="sum")
>>> df.pivot("bar", index="foo", values="baz", aggregate_function="sum")
shape: (2, 3)
┌─────┬─────┬─────┐
│ foo ┆ y ┆ x │
Expand Down

0 comments on commit 2df04e0

Please sign in to comment.