Repository navigation
fix(records): respect group_by in MappedArray.describe on pandas 3 - #910
Merged
Merged
Conversation
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.
On pandas 3,
MappedArray.describetakes a shortcut throughself.to_pd().describe()when the result is not grouped. That call dropsgroup_by, sodescribe(group_by=False)on a grouped mapped array (e.g. trades of a grouped portfolio) expands with the default grouping: it either returns one column per group or fails with "Multiple values are pointing to the same position". It also fails with "Must pass idx_arr" for mapped arrays without anidx_arr. Now the shortcut usesto_pd(ignore_index=True, group_by=group_by), which needs neither unique positions noridx_arrand gives the same stats. Added agroup_by=Falseassertion totest_describe; the records tests pass.