-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: RT03 fix for min,max,mean,meadian,kurt,skew #57682
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
Closed
Closed
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
88bd06a
DOC: RT03 fix for min,max,mean,meadian,kurt,skew
YashpalAhlawat 74875ab
retrigger checks
YashpalAhlawat 964e8d5
Review Suggestions
YashpalAhlawat 2e87ece
Review Suggestions Implemented
YashpalAhlawat 4483540
updated return type in doc
YashpalAhlawat 00295f5
removed series functions from partially ignoring
YashpalAhlawat ce00d72
Review suggestions
YashpalAhlawat 9411d49
resolve merge conflicts
YashpalAhlawat 495fb1b
refactored logic
YashpalAhlawat 097eb4a
reformatting
YashpalAhlawat 523fc01
updated if logic
YashpalAhlawat 1126083
Resolve merge conflicts
YashpalAhlawat 90555ba
Merge branch 'main' of https://github.com/pandas-dev/pandas into RT03…
YashpalAhlawat eb33a4b
review suggestions
YashpalAhlawat 3d4eeeb
resolve merge conflicts
YashpalAhlawat b8e10e0
logic update
YashpalAhlawat 8b0feb1
Removed additional RT03
YashpalAhlawat 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
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.
I don't think this logic is totally correct.
If I'm not missing anything, there are 3 cases:
Series
: return type is alwaysscalar
, the axis parameter only accepts 0 which is ignored.DataFrame
group 1 (e.g.skew
): axis accepts 0 and 1, return is alwaysSeries
DataFrame
group 2 (e.g.any
): axis accepts 0, 1 and None, return isSeries or scalar
sinceaxis=0
means both axis together and makes the return a scalar.You'll have to check which base_doc belong to each group. Also, can you please rename
name2
toobj_type
or something more descriptive?Also, if you
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.
@datapythonista
In the series case for:
https://pandas.pydata.org/docs/reference/api/pandas.Series.sem.html
https://pandas.pydata.org/docs/reference/api/pandas.Series.std.html
https://pandas.pydata.org/docs/reference/api/pandas.Series.var.html
In all of the above cases return type is Series or scalar as per documentation.
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.
I have made the suggested variable name, etc and modified logic for all cases, verified locally all the cases
For Series
For DataFrame
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.
Thanks for all the detailed information and for the work on this PR @YashpalAhlawat.
Looking at for example
Series.std
, I fail to see a way for the function to return anything that it's not a scalar, thelevel
argument was deprecated and doesn't exist anymore. So the documentation is outdated. I assume it's also the case for the other two functions.For
Series.any
andSeries.all
I think a scalar is always returned as well.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.
Also, for
DataFrame.any
andDataFrame.all
the return time should beSeries or scalar
, notSeries or DataFrame
.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.
@datapythonista ,
For series Std, any , all methods needs to updated. Is level is deprecated from all std, var, sem ?
For dataframe any,all methods need to be updated. Is level is deprecated from dataframe methods also?
Kindly, clear the expectations. I will fix it.
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.
You can check the docstring of the objects. For
var
for example, there is no parameterlevels
: https://pandas.pydata.org/docs/reference/api/pandas.Series.var.htmlI think it's the case for all them, I checked several and I didn't see any with the
level
parameter.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.
For series, all cases will return Scalar, except std, var, sem as all belongs to same group should have Series and Scalar _num_ddof_doc
For DataFrame, all cases should return Series and Scalar, since **skew, max, min, ** belongs to same group _num_doc.
If this looks good to you i will proceed and implement.
@datapythonista please review
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.
For Series, cumsum and similar returns Series I think. And for Dataframe I think it can return DataFrame or Series as you had. For the rest what you say sounds correct. You can check the type annotations and examples, and check the parameter axis which is the one that controls what object is being returned.