-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add basic documentation to some of the GroupBy properties and methods #5459
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
Conversation
@dwiel I think you should add this to the API documentation as well. |
@@ -693,6 +711,7 @@ def apply(self, f, data, axis=0): | |||
|
|||
@cache_readonly | |||
def indices(self): | |||
""" dict {group name -> group indices """ |
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.
missing the second }
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.
doh, looks like the same thing happened on the GroupBy.indicies docstring as well. Just pushed a fix for both of them
@rockg, is there documentation somewhere about how to do that? I've looked around a little bit, but I'm not finding anything. |
look at api.rst |
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
GroupBy.__iter__ |
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 the GroupBy
object is available in the pandas namespace. I think you will have to add something like .. currentmodule:: pandas.core.groupby
This might be a related issue: #4500 |
yeah, #4500 deffinitely looks related, though the bulk of the conversation is more about automatic missing documentation finding rather than the original topic of lacking GroupBy documentation. I left GroupBy.ngroups undocumented because it always gives the same result as len, but the code paths are different, and it wasn't clear to me why. |
Super that you wan't to work on this! Docs on these groupby things are really a gap in the documentation at the moment IMHO.. I also have been thinking about it some time ago, and I think there are some issues to pay attention to:
But it is certainly a good start! Something else (but that is a broader discussion), the mentioning of |
@dwiel #4887 is the issue which esentially whitelisted methods that can be used on groupby |
@dwiel Do you have time to finish this? If you have some more time, the |
I've added an explanation to api.rst and squashed the commits. I'm not entirely sure how to get the comments into the api.rst since the doc string is there, its just loaded with the Appender decorator. The docstring shows up in ipython help for example. If you would rather I remove them from the api.rst for now since it isn't picking them up, that is fine. I haven't made many contributions to Open Source projects yet, but your previous comment @jorisvandenbossche was the first appreciative comment I've received, and it was very welcome. Thanks! |
------- | ||
.. currentmodule:: pandas.core.groupby | ||
|
||
**GroupBy objects are returned by groupby calls: DataFrame.groupby, Series.groupby, etc.** |
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 make DataFrame.groupby
link to the rendered docstring of groupby by using :func:
pandas.DataFrame.groupby``. However, this will not work in the bold text environment ** ... **
.
And you are thanked for your contribution! I added one more comment. |
…thods DOC: add GroupBy class to api.rst DOC: add import for GroupBy object to api.rst DOC: add GroupBy.aggregate and GroupBy.transform to api.rst DOC: add meta comment to api.rst about when GroupBy objects are created DOC: add links to api.rst
@jorisvandenbossche can you review? |
@jreback I think my most important comments are adressed, and the others can wait for later PRs (I will turn them in some issues). |
ok.....will merge this then |
DOC: add basic documentation to some of the GroupBy properties and methods
@dwiel thanks for this! (and what a bummer that you didn't get positive |
The feedback is appreciated, I was getting worried that I wasn't actually helping. |
I added some simple documentation to the GroupBy and Grouper classes