Skip to content

DOC: SeriesGroupby/DataFrameGroupBy is missing class documentaion from doc index #19302

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

Open
allComputableThings opened this issue Jan 18, 2018 · 6 comments

Comments

@allComputableThings
Copy link

Problem description

https://pandas-docs.github.io/pandas-docs-travis/generated/pandas.Grouper.html#pandas.Grouper

There are many references to the GroupBy class in the index -- but there is no class interface documentation listed in the index.

We have, for example "Categorical (class in pandas)", but not "GroupBy (class in pandas)"
which would let us know which methods are available in GroupBy.

@jreback
Copy link
Contributor

jreback commented Jan 18, 2018

GroupBy is not a public class. not sure what you are expecting here.

@jreback jreback added the Docs label Jan 18, 2018
@TomAugspurger
Copy link
Contributor

@stuz5000 can you clarify, are you interested in API docs for the object you get back from DataFrame.groupby? We have an internal class pandas.core.GroupBy, but users see either DataFrameGroupBy or SeriesGroupBy:

In [7]: df = pd.DataFrame({"A": range(10)})

In [8]: gr = df.groupby("A")

In [9]: type(gr)
Out[9]: pandas.core.groupby.DataFrameGroupBy

It'll take a bit of work before DataFrameGroupBy can be included in the API docs I think.

@allComputableThings
Copy link
Author

allComputableThings commented Jan 19, 2018 via email

@jorisvandenbossche
Copy link
Member

We currently list methods of GroupBy in the API docs: http://pandas.pydata.org/pandas-docs/stable/api.html#groupby
And I think it can be useful to document the class that you get back from groupby. This is indeed SeriesGroupby or DataFrameGroupBy, but we could also document GroupBy for both of them together (as we do for other generic methods of them).

Anyhow, their docstring (all three share the same one) would indeed need some work to be ready to included (now it explains things that are internal).

My issue is that I have no way to what methods are available on the result of group by. Is sortXXX available? No way to know without a trip to stackoverflow.

You can already check what is listed here: http://pandas.pydata.org/pandas-docs/stable/api.html#groupby (or use tab completion on the return object)

@allComputableThings allComputableThings changed the title DOC: GroupBy is missing class documentaion DOC: SeriesGroupby/DataFrameGroupBy is missing class documentaion from doc index Jan 19, 2018
@allComputableThings
Copy link
Author

allComputableThings commented Jan 19, 2018

@jorisvandenbossche Thanks - this page is extremely useful.

I didn't understand the distinction because the docs for DataFrame.groupby says it returns a GroupBy not a DataFrameGroupBy, so that's where I went hunting.

Its very hard to understand what you can do with a DataFrame.groupby() by following the docs for that method. It would help to show in the DataFrame.groupby page what concrete classes may be returned and have links to the class-level docs for these from there (and in the index: "DataFrameGroupBy class in pandas" "SeriesGroupBy class in pandas").

I've updated the title.

@jreback
Copy link
Contributor

jreback commented Jan 19, 2018

we have a master list of these needed docs in #6944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants