From ecf58519f0feb9bd4e3d0c5d797a67fd72f7ff9e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 4 Aug 2014 09:55:36 +0200 Subject: [PATCH] DOC: small fixes categorical docs --- doc/source/basics.rst | 4 ++-- doc/source/categorical.rst | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/basics.rst b/doc/source/basics.rst index 32c0a78e394c5..93933140ab11c 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -1574,8 +1574,8 @@ dtypes: 'float64': np.arange(4.0, 7.0), 'bool1': [True, False, True], 'bool2': [False, True, False], - 'dates': pd.date_range('now', periods=3).values}), - 'category': pd.Categorical(list("ABC)) + 'dates': pd.date_range('now', periods=3).values, + 'category': pd.Categorical(list("ABC"))}) df['tdeltas'] = df.dates.diff() df['uint64'] = np.arange(3, 6).astype('u8') df['other_dates'] = pd.date_range('20130101', periods=3).values diff --git a/doc/source/categorical.rst b/doc/source/categorical.rst index c758dde16837b..d8b8168e05d8b 100644 --- a/doc/source/categorical.rst +++ b/doc/source/categorical.rst @@ -228,11 +228,11 @@ Appending levels can be done by assigning a levels list longer than the current Adding levels in other positions can be done with ``.reorder_levels()``. Removing a level is also possible, but only the last level(s) can be removed by assigning a -shorter list than current levels. Values which are omitted are replaced by `np.nan`. +shorter list than current levels. Values which are omitted are replaced by ``np.nan``. .. ipython:: python - s.levels = [1,2] + s.cat.levels = [1,2] s .. note:: @@ -322,7 +322,7 @@ old levels: .. ipython:: python s3 = pd.Series(pd.Categorical(["a","b","d"])) - s3.cat.reorder_levels(["a","b","c",d"]) + s3.cat.reorder_levels(["a","b","c","d"]) s3