From b62309f9206d4e6f2446533461c08e0a5cee5c1a Mon Sep 17 00:00:00 2001 From: JarnoRFB Date: Thu, 31 May 2018 00:24:20 +0200 Subject: [PATCH] Fix Renaming categories section The categories were not correctly saved so that the renaming using the dict-like object had no effect. --- doc/source/categorical.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/categorical.rst b/doc/source/categorical.rst index e4ce7ebd01dac..c6827f67a390b 100644 --- a/doc/source/categorical.rst +++ b/doc/source/categorical.rst @@ -358,10 +358,10 @@ Renaming categories is done by assigning new values to the s s.cat.categories = ["Group %s" % g for g in s.cat.categories] s - s.cat.rename_categories([1,2,3]) + s = s.cat.rename_categories([1,2,3]) s # You can also pass a dict-like object to map the renaming - s.cat.rename_categories({1: 'x', 2: 'y', 3: 'z'}) + s = s.cat.rename_categories({1: 'x', 2: 'y', 3: 'z'}) s .. note::