Skip to content

Commit b4c6fc1

Browse files
committed
DOC: add some See Also to Categorical
1 parent b7ddb0a commit b4c6fc1

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

doc/source/api.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,21 @@ adding ordering information or special categories is need at creation time of th
653653
Categorical.from_codes
654654

655655
``np.asarray(categorical)`` works by implementing the array interface. Be aware, that this converts
656-
the Categorical back to a numpy array, so levels and order information is not preserved!
656+
the Categorical back to a numpy array, so categories and order information is not preserved!
657657

658658
.. autosummary::
659659
:toctree: generated/
660660

661661
Categorical.__array__
662662

663+
Categorical methods
664+
665+
.. autosummary::
666+
:toctree: generated/
667+
668+
Categorical.unique
669+
Categorical.value_counts
670+
663671
Plotting
664672
~~~~~~~~
665673

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def unique(values):
287287
288288
Examples
289289
--------
290-
pd.unique(pd.Series([2, 1, 3, 3]))
290+
>>> pd.unique(pd.Series([2, 1, 3, 3]))
291291
array([2, 1, 3])
292292
293293
>>> pd.unique(pd.Series([2] + [1] * 5))

pandas/core/categorical.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,9 @@ def isnull(self):
11371137
11381138
See also
11391139
--------
1140-
pandas.isnull : pandas version
1140+
isnull : pandas version
11411141
Categorical.notnull : boolean inverse of Categorical.isnull
1142+
11421143
"""
11431144

11441145
ret = self._codes == -1
@@ -1164,8 +1165,9 @@ def notnull(self):
11641165
11651166
See also
11661167
--------
1167-
pandas.notnull : pandas version
1168+
notnull : pandas version
11681169
Categorical.isnull : boolean inverse of Categorical.notnull
1170+
11691171
"""
11701172
return ~self.isnull()
11711173

@@ -1206,6 +1208,11 @@ def value_counts(self, dropna=True):
12061208
Returns
12071209
-------
12081210
counts : Series
1211+
1212+
See Also
1213+
--------
1214+
Series.value_counts
1215+
12091216
"""
12101217
from numpy import bincount
12111218
from pandas.types.missing import isnull
@@ -1308,6 +1315,7 @@ def sort_values(self, inplace=False, ascending=True, na_position='last'):
13081315
See Also
13091316
--------
13101317
Categorical.sort
1318+
Series.sort_values
13111319
13121320
Examples
13131321
--------
@@ -1919,8 +1927,9 @@ def unique(self):
19191927
19201928
See Also
19211929
--------
1922-
pandas.unique
1923-
pandas.CategoricalIndex.unique
1930+
unique
1931+
CategoricalIndex.unique
1932+
Series.unique
19241933
19251934
"""
19261935

0 commit comments

Comments
 (0)