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
Actually in master, I don't think dtype of the output is being maintained in any of these funcs 'count', 'sum', 'std', 'var', 'sem', 'mean', 'median', 'prod', 'min', 'max'
Is the expectation that the output will have the original dtypes, i.e. int64, Int64, int64 ?
Is the expectation that the output will have the original dtypes, i.e. int64, Int64, int64 ?
for the code sample, that would be reasonable, although returning float64 for the Int64 columns would probably also be acceptable as that was the return type before the regression.
How does the changes in PR relate to the changes in the PR that caused the regression #41706? (or to put it a different way, which change in #41706 caused the regression and how does this PR rectify that?)
Before #41706, the actual calculation was happening in agg_general in result = self.aggregate(lambda x: npfunc(x, axis=self.axis)).
Honestly, I didn't try to undo what that patch did, I went on to fix the inconsistency in the result coming post that patch.
Agreed @debnathshoham - on master, the dtypes in @simonjayhawkins' example come out at all float. What you have here is certainly an improvement over that, but it doesn't fully fix the regression. It's unclear to me if this patch is a good step in fully resolving the regression, or if fully solving it would make this patch obsolete. Will need to investigate more.
added comments in the tests.
To summarise, for df with mixed dtypes like below.
For sum - Columns with Int64 was cast to float64 in 1.2.5, whereas in this PR it would cast to int64.
For std - ValueError : Length mismatch in 1.2.5. In this PR they come as float64.
Fot var - DataError : No numeric types to aggregate in 1.2.5. In this PR they come as float64
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the comments here - appreciate the extra detail, but they shouldn't be part of a test; surfacing this in a comment on github directly would be great (and you already have another comment that does something similar - thanks for that as well).
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.