@@ -794,28 +794,28 @@ def categories(self) -> Index:
794
794
795
795
>>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
796
796
>>> ser.cat.categories
797
- Index(['a', 'b', 'c'], dtype='object ')
797
+ Index(['a', 'b', 'c'], dtype='str ')
798
798
799
799
>>> raw_cat = pd.Categorical(["a", "b", "c", "a"], categories=["b", "c", "d"])
800
800
>>> ser = pd.Series(raw_cat)
801
801
>>> ser.cat.categories
802
- Index(['b', 'c', 'd'], dtype='object ')
802
+ Index(['b', 'c', 'd'], dtype='str ')
803
803
804
804
For :class:`pandas.Categorical`:
805
805
806
806
>>> cat = pd.Categorical(["a", "b"], ordered=True)
807
807
>>> cat.categories
808
- Index(['a', 'b'], dtype='object ')
808
+ Index(['a', 'b'], dtype='str ')
809
809
810
810
For :class:`pandas.CategoricalIndex`:
811
811
812
812
>>> ci = pd.CategoricalIndex(["a", "c", "b", "a", "c", "b"])
813
813
>>> ci.categories
814
- Index(['a', 'b', 'c'], dtype='object ')
814
+ Index(['a', 'b', 'c'], dtype='str ')
815
815
816
816
>>> ci = pd.CategoricalIndex(["a", "c"], categories=["c", "b", "a"])
817
817
>>> ci.categories
818
- Index(['c', 'b', 'a'], dtype='object ')
818
+ Index(['c', 'b', 'a'], dtype='str ')
819
819
"""
820
820
return self .dtype .categories
821
821
0 commit comments