File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change 6
6
import numpy as np
7
7
8
8
from pandas ._libs import lib , missing as libmissing
9
+ from pandas .util ._decorators import doc
9
10
from pandas .util ._validators import validate_fillna_kwargs
10
11
11
12
from pandas .core .dtypes .base import ExtensionDtype
@@ -254,30 +255,8 @@ def __len__(self) -> int:
254
255
"""
255
256
return len (self ._data )
256
257
258
+ @doc (ExtensionArray .factorize )
257
259
def factorize (self , na_sentinel : int = - 1 ) -> Tuple [np .ndarray , ExtensionArray ]:
258
- """Encode the extension array as an enumerated type.
259
- Parameters
260
- ----------
261
- na_sentinel : int, default -1
262
- Value to use in the `labels` array to indicate missing values.
263
- Returns
264
- -------
265
- labels : ndarray
266
- An integer NumPy array that's an indexer into the original
267
- ExtensionArray.
268
- uniques : ExtensionArray
269
- An ExtensionArray containing the unique values of `self`.
270
- .. note::
271
- uniques will *not* contain an entry for the NA value of
272
- the ExtensionArray if there are any missing values present
273
- in `self`.
274
- See Also
275
- --------
276
- pandas.factorize : Top-level factorize method that dispatches here.
277
- Notes
278
- -----
279
- :meth:`pandas.factorize` offers a `sort` keyword as well.
280
- """
281
260
if pa .types .is_dictionary (self ._data .type ):
282
261
raise NotImplementedError ()
283
262
elif self ._data .num_chunks == 1 :
You can’t perform that action at this time.
0 commit comments