diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f1e7f6d477906..47a2cf93a4f89 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -1882,8 +1882,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then MSG='Partially validate docstrings (RT03)' ; echo $MSG $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=RT03 --ignore_functions \ - pandas.Index.to_numpy\ - pandas.Categorical.set_categories\ pandas.CategoricalIndex.set_categories\ pandas.DataFrame.astype\ pandas.DataFrame.at_time\ diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 886fe4594c17b..49b8ba4c47811 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1064,14 +1064,14 @@ def set_categories( On the other hand this methods does not do checks (e.g., whether the old categories are included in the new categories on a reorder), which can result in surprising changes, for example when using special string - dtypes, which does not considers a S1 string equal to a single char + dtypes, which do not consider a S1 string equal to a single char python string. Parameters ---------- new_categories : Index-like The categories in new order. - ordered : bool, default False + ordered : bool, default None Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. rename : bool, default False @@ -1080,7 +1080,8 @@ def set_categories( Returns ------- - Categorical with reordered categories. + Categorical + New categories to be used, with optional ordering changes. Raises ------ diff --git a/pandas/core/base.py b/pandas/core/base.py index 7a3d6cb866ea5..4556b9ab4d4c9 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -566,6 +566,8 @@ def to_numpy( Returns ------- numpy.ndarray + The NumPy ndarray holding the values from this Series or Index. + The dtype of the array may differ. See Notes. See Also --------