-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: Parameter for pivot to always include value column name #26730
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e4e941d
Support always combining column names in pivots.
pythonspeed a66c11c
More accurate signature.
pythonspeed 9428a28
Use new API in docs
pythonspeed 7feb99e
Switch to a better name, and a match.
pythonspeed 9210eea
Merge remote-tracking branch 'origin/main' into 26700-pivot-names
pythonspeed e4e96d0
Undo unrelated formatting changes.
pythonspeed 14415cb
Merge remote-tracking branch 'origin/main' into 26700-pivot-names
nameexhaustion 7ae52c9
unstable docstring
nameexhaustion 347d5d8
always_combine->combine naming
nameexhaustion b19f641
hashes
nameexhaustion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8089,6 +8089,7 @@ def pivot( | |
| aggregate_function: PivotAgg | Expr | None = None, | ||
| maintain_order: bool = False, | ||
| separator: str = "_", | ||
| column_naming: Literal["auto", "always_combine"] = "auto", | ||
| ) -> LazyFrame: | ||
| """ | ||
| Create a spreadsheet-style pivot table as a DataFrame. | ||
|
|
@@ -8123,6 +8124,13 @@ def pivot( | |
| separator | ||
| Used as separator/delimiter in generated column names in case of multiple | ||
| `values` columns. | ||
| column_naming : {'auto', 'always_combine'} | ||
|
||
| How resulting column names will be constructed. | ||
|
|
||
| * 'auto': The default; combine with separator if there are multiple | ||
| `values` columns, otherwise just use the `on_columns` names. | ||
| * 'always_combine': Always combine the `values` columns' names with | ||
| the `on_columns` names. | ||
|
|
||
| Returns | ||
| ------- | ||
|
|
@@ -8315,6 +8323,7 @@ def pivot( | |
| agg=agg._pyexpr, | ||
| maintain_order=maintain_order, | ||
| separator=separator, | ||
| column_naming=column_naming, | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Says
always_combinerather thancombine.