Skip to content

Commit 7228881

Browse files
topper-123Pingviinituutti
authored andcommitted
CLN: doc string (pandas-dev#23469)
1 parent bdc590a commit 7228881

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/generic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5279,7 +5279,9 @@ def astype(self, dtype, copy=True, errors='raise', **kwargs):
52795279
52805280
Convert to ordered categorical type with custom ordering:
52815281
5282-
>>> ser.astype('category', ordered=True, categories=[2, 1])
5282+
>>> cat_dtype = pd.api.types.CategoricalDtype(
5283+
... categories=[2, 1], ordered=True)
5284+
>>> ser.astype(cat_dtype)
52835285
0 1
52845286
1 2
52855287
dtype: category

0 commit comments

Comments
 (0)