Skip to content

DOC: update api.rst for Categorical accessors / methods #15957

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
jreback opened this issue Apr 9, 2017 · 6 comments · Fixed by #15964
Closed

DOC: update api.rst for Categorical accessors / methods #15957

jreback opened this issue Apr 9, 2017 · 6 comments · Fixed by #15964
Labels

Comments

@jreback
Copy link
Contributor

jreback commented Apr 9, 2017

we have a Categorical section, but this mainly describes .cat. Maybe split this out into a separate section to document the actual Categorical methods / accessors (even though it is slightly duplicative.

http://pandas-docs.github.io/pandas-docs-travis/api.html#categorical

also need to add other public methods (that are not available on .cat). This is actually a big list, things like:

isnull, unique, map, value_counts, etc.

These are all Series like methods / accessors.

@jreback jreback added this to the Next Major Release milestone Apr 9, 2017
@jreback
Copy link
Contributor Author

jreback commented Apr 9, 2017

@jreback
Copy link
Contributor Author

jreback commented Apr 9, 2017

I pushed a tiny update: b4c6fc1

but I think should create a separate sub-section for this

@jorisvandenbossche
Copy link
Member

I think this absence was rather intentional. Because people should actually mostly use categorical Series, we didn't want to give too much attention to plain Categorical in the docs?

Quoting from the API docs:

The following two Categorical constructors are considered API

which shows the Categorical / Cateogorical.from_codes constructors. This implies that the rest of the methods are not considered as public API.
I actually think a Categorical should not have a value_counts, so IMO should not be added.

@jreback
Copy link
Contributor Author

jreback commented Apr 9, 2017

the problem is we cannot reference these from other doc-strings then. I suppose we could have a hidden section?

@jreback
Copy link
Contributor Author

jreback commented Apr 9, 2017

I mainly wanted to reference Categorical.unique (for the examples, even though they are in pd.unique)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Apr 10, 2017

I think we should just not reference them then, as you say yourself, the examples are also in pd.unique (but the categorical unique is indeed a case where there is now additional information in that docstring that is useful).

People will actually typically look at Series.unique docstring when they work interactively and have a categorical series. And looking at that now, there are no examples included there, but all are in pd.unique. So maybe we should include them there as well, or explicitly state "see pd.unique docstring for full documentation" ?

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

Successfully merging a pull request may close this issue.

2 participants