@@ -1831,7 +1831,7 @@ def argsort(self, ascending=True, kind="quicksort", **kwargs):
18311831 Examples
18321832 --------
18331833 >>> pd.Categorical(['b', 'b', 'a', 'c']).argsort()
1834- array([2, 0, 1, 3], dtype=int64 )
1834+ array([2, 0, 1, 3])
18351835
18361836 >>> cat = pd.Categorical(['b', 'b', 'a', 'c'],
18371837 ... categories=['c', 'b', 'a'],
@@ -2227,29 +2227,28 @@ def _validate_listlike(self, value):
22272227
22282228 def _reverse_indexer (self ) -> dict [Hashable , npt .NDArray [np .intp ]]:
22292229 """
2230- Compute the inverse of a categorical, returning
2231- a dict of categories -> indexers.
2232-
2233- *This is an internal function*
2234-
2235- Returns
2236- -------
2237- Dict[Hashable, np.ndarray[np.intp]]
2238- dict of categories -> indexers
2239-
2240- Examples
2241- --------
2242- >>> c = pd.Categorical(list('aabca'))
2243- >>> c
2244- ['a', 'a', 'b', 'c', 'a']
2245- Categories (3, object): ['a', 'b', 'c']
2246- >>> c.categories
2247- Index(['a', 'b', 'c'], dtype='object')
2248- >>> c.codes
2249- array([0, 0, 1, 2, 0], dtype=int8)
2250- >>> c._reverse_indexer()
2251- {'a': array([0, 1, 4], dtype=int64), 'b':
2252- array([2], dtype=int64), 'c': array([3], dtype=int64)}
2230+ Compute the inverse of a categorical, returning
2231+ a dict of categories -> indexers.
2232+
2233+ *This is an internal function*
2234+
2235+ Returns
2236+ -------
2237+ Dict[Hashable, np.ndarray[np.intp]]
2238+ dict of categories -> indexers
2239+
2240+ Examples
2241+ --------
2242+ >>> c = pd.Categorical(list('aabca'))
2243+ >>> c
2244+ ['a', 'a', 'b', 'c', 'a']
2245+ Categories (3, object): ['a', 'b', 'c']
2246+ >>> c.categories
2247+ Index(['a', 'b', 'c'], dtype='object')
2248+ >>> c.codes
2249+ array([0, 0, 1, 2, 0], dtype=int8)
2250+ >>> c._reverse_indexer()
2251+ {'a': array([0, 1, 4]), 'b': array([2]), 'c': array([3])}
22532252
22542253 """
22552254 categories = self .categories
0 commit comments