Skip to content

Commit b22b8ae

Browse files
author
tp
committed
Fixed errors in doc string for Categorical + cleanup
1 parent d43aba8 commit b22b8ae

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pandas/core/categorical.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,21 @@ class Categorical(PandasObject):
199199
>>> from pandas import Categorical
200200
>>> Categorical([1, 2, 3, 1, 2, 3])
201201
[1, 2, 3, 1, 2, 3]
202-
Categories (3, int64): [1 < 2 < 3]
202+
Categories (3, int64): [1, 2, 3]
203203
204204
>>> Categorical(['a', 'b', 'c', 'a', 'b', 'c'])
205205
[a, b, c, a, b, c]
206-
Categories (3, object): [a < b < c]
206+
Categories (3, object): [a, b, c]
207207
208208
Only ordered `Categoricals` can be sorted (according to the order
209209
of the categories) and have a min and max value.
210210
211-
>>> a = Categorical(['a','b','c','a','b','c'], ['c', 'b', 'a'],
212-
ordered=True)
213-
>>> a.min()
211+
>>> c = Categorical(['a','b','c','a','b','c'], categories=['c', 'b', 'a'],
212+
... ordered=True)
213+
>>> c
214+
[a, b, c, a, b, c]
215+
Categories (3, object): [c < b < a]
216+
>>> c.min()
214217
'c'
215218
216219
Notes
@@ -219,11 +222,8 @@ class Categorical(PandasObject):
219222
220223
See also
221224
--------
222-
Categorical.sort
223-
Categorical.order
224-
Categorical.min
225-
Categorical.max
226225
pandas.api.types.CategoricalDtype
226+
CategoricalIndex : An Index with an underlying ``Categorical``
227227
"""
228228

229229
# For comparisons, so that numpy uses our implementation if the compare

0 commit comments

Comments
 (0)