Skip to content

DOC: Document a few more methods for Categorical Array #56927

Closed
@ivirshup

Description

@ivirshup

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.Categorical.html#pandas.Categorical

Documentation problem

The only documented methods for the Categorical class are from_codes and __array__. However a bunch of other methods exist and have docstrings written. These include:

  • from_codes
  • as_ordered
  • as_unordered
  • set_categories
  • rename_categories
  • reorder_categories
  • add_categories
  • remove_categories
  • remove_unused_categories
  • map

The above are just some of the methods which are specific to categorical. There are then also methods (with doc strings) like: astype, isin, min, max, describe, etc.

Suggested fix for documentation

I think at least some of these should show up in the rendered docs. Maybe all, but that could also lead to crowded docs.

I see it has been suggested in the past that only selected methods are documented, but I'm not sure if a criteria has been established.

At a minimum, I would add all the categorical specific methods that I've listed above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions