You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.16.0.txt
+23-6
Original file line number
Diff line number
Diff line change
@@ -380,12 +380,29 @@ New Behavior
380
380
381
381
For ease of creation of series of categorical data, we have added the ability to pass keywords when calling ``.astype()``. These are passed directly to the constructor.
382
382
383
-
.. ipython:: python
384
-
385
-
s = Series(["a","b","c","a"]).astype('category',ordered=True)
386
-
s
387
-
s = Series(["a","b","c","a"]).astype('category',categories=list('abcdef'),ordered=False)
388
-
s
383
+
.. code-block:: python
384
+
385
+
In [54]: s = Series(["a","b","c","a"]).astype('category',ordered=True)
386
+
387
+
In [55]: s
388
+
Out[55]:
389
+
0 a
390
+
1 b
391
+
2 c
392
+
3 a
393
+
dtype: category
394
+
Categories (3, object): [a < b < c]
395
+
396
+
In [56]: s = Series(["a","b","c","a"]).astype('category',categories=list('abcdef'),ordered=False)
0 commit comments