@@ -197,34 +197,34 @@ class Categorical(PandasObject):
197
197
198
198
Examples
199
199
--------
200
- >>> from pandas import Categorical
201
- >>> Categorical([1, 2, 3, 1, 2, 3])
200
+ >>> pd.Categorical([1, 2, 3, 1, 2, 3])
202
201
[1, 2, 3, 1, 2, 3]
203
- Categories (3, int64): [1 < 2 < 3]
202
+ Categories (3, int64): [1, 2, 3]
204
203
205
- >>> Categorical(['a', 'b', 'c', 'a', 'b', 'c'])
204
+ >>> pd. Categorical(['a', 'b', 'c', 'a', 'b', 'c'])
206
205
[a, b, c, a, b, c]
207
- Categories (3, object): [a < b < c]
206
+ Categories (3, object): [a, b, c]
208
207
209
- Only ordered `Categoricals` can be sorted ( according to the order
210
- of the categories) and have a min and max value.
208
+ Ordered `Categoricals` can be sorted according to the custom order
209
+ of the categories and can have a min and max value.
211
210
212
- >>> a = Categorical(['a','b','c','a','b','c'], ['c', 'b', 'a'],
213
- ordered=True)
214
- >>> a.min()
211
+ >>> c = pd.Categorical(['a','b','c','a','b','c'], ordered=True,
212
+ ... categories=['c', 'b', 'a'])
213
+ >>> c
214
+ [a, b, c, a, b, c]
215
+ Categories (3, object): [c < b < a]
216
+ >>> c.min()
215
217
'c'
216
218
217
219
Notes
218
220
-----
219
- See the :ref:`user guide <categorical>` for more.
221
+ See the `user guide
222
+ <http://pandas.pydata.org/pandas-docs/stable/categorical.html>`_ for more.
220
223
221
224
See also
222
225
--------
223
- Categorical.sort
224
- Categorical.order
225
- Categorical.min
226
- Categorical.max
227
226
pandas.api.types.CategoricalDtype
227
+ CategoricalIndex : An Index with an underlying ``Categorical``
228
228
"""
229
229
230
230
# For comparisons, so that numpy uses our implementation if the compare
0 commit comments