Skip to content

Commit 2a4648a

Browse files
committed
DOC: whatsnew fix for str/dt
1 parent 7f80384 commit 2a4648a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

doc/source/categorical.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,12 @@ type:
526526

527527
.. ipython:: python
528528
529-
str_s = pd.Series(list('aabb'))
530-
str_cat = str_s.astype('category')
529+
str_cat = pd.Series(list('aabb')).astype('category')
530+
str_cat
531531
str_cat.str.contains("a")
532532
533-
date_s = pd.Series(date_range('1/1/2015', periods=5))
534-
date_cat = date_s.astype('category')
533+
date_cat = pd.Series(date_range('1/1/2015', periods=5)).astype('category')
534+
date_cat
535535
date_cat.dt.day
536536
537537
.. note::

doc/source/whatsnew/v0.17.1.txt

+10
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ Enhancements
8181

8282
- Series of type ``"category"`` now make ``.str.<...>`` and ``.dt.<...>`` accessor methods / properties available, if the categories are of that type. (:issue:`10661`)
8383

84+
.. ipython:: python
85+
86+
s = pd.Series(list('aabb')).astype('category')
87+
s
88+
s.str.contains("a")
89+
90+
date = pd.Series(date_range('1/1/2015', periods=5)).astype('category')
91+
date
92+
date.dt.day
93+
8494
- ``pivot_table`` now has a ``margins_name`` argument so you can use something other than the default of 'All' (:issue:`3335`)
8595
- Implement export of ``datetime64[ns, tz]`` dtypes with a fixed HDF5 store (:issue:`11411`)
8696

0 commit comments

Comments
 (0)