Skip to content

Commit

Permalink
DOC: fixing PR01 errors for pandas.Categorical and pandas.Categorical…
Browse files Browse the repository at this point in the history
….__array__ (pandas-dev#57561)

* fixing PR01 errors for pandas.Categorical and pandas.Categorical.__array__

* updated dtype to np.dtype

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
2 people authored and pmhatre1 committed May 7, 2024
1 parent dd9fda3 commit dde20f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (PR01)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR01 --ignore_functions \
pandas.Categorical\
pandas.Categorical.__array__\
pandas.CategoricalIndex.equals\
pandas.CategoricalIndex.map\
pandas.DataFrame.at_time\
Expand Down
10 changes: 10 additions & 0 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ class Categorical(NDArrayBackedExtensionArray, PandasObject, ObjectStringArrayMi
provided).
dtype : CategoricalDtype
An instance of ``CategoricalDtype`` to use for this categorical.
fastpath : bool
The 'fastpath' keyword in Categorical is deprecated and will be
removed in a future version. Use Categorical.from_codes instead.
copy : bool, default True
Whether to copy if the codes are unchanged.
Attributes
----------
Expand Down Expand Up @@ -1657,6 +1662,11 @@ def __array__(self, dtype: NpDtype | None = None) -> np.ndarray:
"""
The numpy array interface.
Parameters
----------
dtype : np.dtype or None
Specifies the the dtype for the array.
Returns
-------
numpy.array
Expand Down

0 comments on commit dde20f9

Please sign in to comment.