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