Allow DataFrame.aggregate to accept None for no grouping#1581
Open
kosiew wants to merge 1 commit into
Open
Conversation
…y list - Updated `group_by` method to accept `None` and normalize it to an empty list. - Improved docstring for clarity. - Added regression test in `test_dataframe.py` to verify that `None` equals an empty list. - Updated documentation to mention that `group_by=None` is now supported.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
This makes
DataFrame.aggregateacceptNoneas a more Pythonic way to express aggregation over the whole DataFrame without grouping, equivalent to passing an empty list.What changes are included in this PR?
DataFrame.aggregateto allowgroup_by=None.Nonethe same as an emptygroup_bylist.aggregatedocstring examples and user guide documentation to mentionNone.Are these changes tested?
Yes. This PR adds:
test_aggregate_none_group_by_equivalent_to_empty_listAre there any user-facing changes?
Yes. Users can now call:
as an alternative to:
This is not a breaking API change.
LLM-generated code disclosure
This PR includes code, comments generated with assistance from LLM. All LLM-generated content has been manually reviewed and tested.