@@ -276,9 +276,6 @@ class Categorical(NDArrayBackedExtensionArray, PandasObject, ObjectStringArrayMi
276
276
provided).
277
277
dtype : CategoricalDtype
278
278
An instance of ``CategoricalDtype`` to use for this categorical.
279
- fastpath : bool
280
- The 'fastpath' keyword in Categorical is deprecated and will be
281
- removed in a future version. Use Categorical.from_codes instead.
282
279
copy : bool, default True
283
280
Whether to copy if the codes are unchanged.
284
281
@@ -391,33 +388,15 @@ def __init__(
391
388
categories = None ,
392
389
ordered = None ,
393
390
dtype : Dtype | None = None ,
394
- fastpath : bool | lib .NoDefault = lib .no_default ,
395
391
copy : bool = True ,
396
392
) -> None :
397
- if fastpath is not lib .no_default :
398
- # GH#20110
399
- warnings .warn (
400
- "The 'fastpath' keyword in Categorical is deprecated and will "
401
- "be removed in a future version. Use Categorical.from_codes instead" ,
402
- DeprecationWarning ,
403
- stacklevel = find_stack_level (),
404
- )
405
- else :
406
- fastpath = False
407
-
408
393
dtype = CategoricalDtype ._from_values_or_dtype (
409
394
values , categories , ordered , dtype
410
395
)
411
396
# At this point, dtype is always a CategoricalDtype, but
412
397
# we may have dtype.categories be None, and we need to
413
398
# infer categories in a factorization step further below
414
399
415
- if fastpath :
416
- codes = coerce_indexer_dtype (values , dtype .categories )
417
- dtype = CategoricalDtype (ordered = False ).update_dtype (dtype )
418
- super ().__init__ (codes , dtype )
419
- return
420
-
421
400
if not is_list_like (values ):
422
401
# GH#38433
423
402
raise TypeError ("Categorical input must be list-like" )
0 commit comments