-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Groupbydocs #8231
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
Groupbydocs #8231
Conversation
…DataFrameGroupBy methods
@@ -0,0 +1,63 @@ | |||
# pylint: disable-msg=W0612,E1101,W0141 |
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.
just stick the tests in tests/test_group.py rather than adding a new test file. (you can do it in a new class like you are doing here).
can you indicate which of the checkboxes this will close from the issue. |
…ks to show offending code string
This should close these checkboxes:
I moved the unit test into test_groupby.py, and tweaked the exec'ed strings to fix the syntax error that the CI build was raising. These look like they are passing. Should I submit another pull request? |
@mcjcode Thanks for your work on this! +1 that all the methods now have help messages (didn't look at the implementation yet) But I am not sure I also like adding them all to api.rst. I mean having seperate |
@jorisvandenbossche - I agree. I put all of the additional methods under the |
@@ -2133,9 +2133,105 @@ def _convert_grouper(axis, grouper): | |||
else: | |||
return grouper | |||
|
|||
from inspect import getargspec |
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.
can you move this function inse _whitelist_method_generator? its only called from their yes (and its cleaner that way)
@jreback - I put the The point of the additional tests were to check that ...
The |
@@ -2133,9 +2133,105 @@ def _convert_grouper(axis, grouper): | |||
else: | |||
return grouper | |||
|
|||
def _make_signature(func) : |
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.
can you move this to pandas/utils/decorators.py
? or somewhat similar. doesn't really belong in here as its generic and not related to groupby.
@mcjcode small change, otherwise looks ok to me. |
Moved make_signature from groupby.py to decorators.py. |
merged via 0acfa44 thanks! |
This also "added docstrings to the wrapped whitelisted functions" So we should check that one off as well. |
Addresses #6944, by defining whitelisted methods in the
DataFrameGroupBy
andSeriesGroupBy
class definitions. After this change, users of the whitelisted methods now get useful results fromhelp
, argument name completion, and auto-generated api docs. TheseDataFrameGroupBy
andSeriesGroupBy
methods are added to the api doc. Existing unit tests are extended to check for the presence of the whitelisted methods in the class definitions, and a new unit test verifies that old and new paths produce the same results for methods supporting level, axis, skipna arguments. (Existing methods already explicitly defined inGroupBy
or derived classes are not overwritten.)