77
88import decimal
99import operator
10- from textwrap import dedent
1110from typing import (
1211 TYPE_CHECKING ,
1312 Literal ,
3534 TakeIndexer ,
3635 npt ,
3736)
38- from pandas .util ._decorators import (
39- doc ,
40- set_module ,
41- )
37+ from pandas .util ._decorators import set_module
4238from pandas .util ._exceptions import find_stack_level
4339
4440from pandas .core .dtypes .cast import (
@@ -654,28 +650,6 @@ def factorize_array(
654650
655651
656652@set_module ("pandas" )
657- @doc (
658- values = dedent (
659- """\
660- values : sequence
661- A 1-D sequence. Sequences that aren't pandas objects are
662- coerced to ndarrays before factorization.
663- """
664- ),
665- sort = dedent (
666- """\
667- sort : bool, default False
668- Sort `uniques` and shuffle `codes` to maintain the
669- relationship.
670- """
671- ),
672- size_hint = dedent (
673- """\
674- size_hint : int, optional
675- Hint to the hashtable sizer.
676- """
677- ),
678- )
679653def factorize (
680654 values ,
681655 sort : bool = False ,
@@ -692,12 +666,18 @@ def factorize(
692666
693667 Parameters
694668 ----------
695- {values}{sort}
669+ values : sequence
670+ A 1-D sequence. Sequences that aren't pandas objects are
671+ coerced to ndarrays before factorization.
672+ sort : bool, default False
673+ Sort `uniques` and shuffle `codes` to maintain the
674+ relationship.
696675 use_na_sentinel : bool, default True
697676 If True, the sentinel -1 will be used for NaN values. If False,
698677 NaN values will be encoded as non-negative integers and will not drop the
699678 NaN from the uniques of the values.
700- {size_hint}\
679+ size_hint : int, optional
680+ Hint to the hashtable sizer.
701681
702682 Returns
703683 -------
0 commit comments