MCPcopy
hub / github.com/pandas-dev/pandas / factorize

Method factorize

pandas/core/indexes/range.py:754–765  ·  view source on GitHub ↗
(
        self,
        sort: bool = False,
        use_na_sentinel: bool = True,
    )

Source from the content-addressed store, hash-verified

752 return np.arange(start, stop, step, dtype=np.intp)
753
754 def factorize(
755 self,
756 sort: bool = False,
757 use_na_sentinel: bool = True,
758 ) -> tuple[npt.NDArray[np.intp], RangeIndex]:
759 if sort and self.step < 0:
760 codes = np.arange(len(self) - 1, -1, -1, dtype=np.intp)
761 uniques = self[::-1]
762 else:
763 codes = np.arange(len(self), dtype=np.intp)
764 uniques = self
765 return codes, uniques
766
767 def equals(self, other: object) -> bool:
768 """

Callers 5

_factorize_keysFunction · 0.45
_codes_and_uniquesMethod · 0.45
_insert_quantile_levelFunction · 0.45
nuniqueMethod · 0.45
value_countsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected