From ea479b2aaad6af4beb917d173f5c03fb85be3412 Mon Sep 17 00:00:00 2001 From: Maru5er <74164821+Maru5er@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:55:17 -0700 Subject: [PATCH 1/3] Fix : removed na_action=ignore workaround for categorical data --- pandas/core/apply.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/core/apply.py b/pandas/core/apply.py index 7d50b466f5126..a7d33c81a6e6d 100644 --- a/pandas/core/apply.py +++ b/pandas/core/apply.py @@ -1469,10 +1469,7 @@ def curried(x): # row-wise access # apply doesn't have a `na_action` keyword and for backward compat reasons # we need to give `na_action="ignore"` for categorical data. - # TODO: remove the `na_action="ignore"` when that default has been changed in - # Categorical (GH51645). - action = "ignore" if isinstance(obj.dtype, CategoricalDtype) else None - mapped = obj._map_values(mapper=curried, na_action=action) + mapped = obj._map_values(mapper=curried) if len(mapped) and isinstance(mapped[0], ABCSeries): # GH#43986 Need to do list(mapped) in order to get treated as nested From 799b979dafd54e1b9dec0f1e43393611f437836b Mon Sep 17 00:00:00 2001 From: Maru5er <74164821+Maru5er@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:11:12 -0700 Subject: [PATCH 2/3] Fix : removed na_action=ignore workaround for categorical data and import style --- pandas/core/apply.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/apply.py b/pandas/core/apply.py index a7d33c81a6e6d..77faacc12e537 100644 --- a/pandas/core/apply.py +++ b/pandas/core/apply.py @@ -39,7 +39,6 @@ is_sequence, ) from pandas.core.dtypes.dtypes import ( - CategoricalDtype, ExtensionDtype, ) from pandas.core.dtypes.generic import ( From a1d3338ee30167358619b221dcb7e8cd38f3f3db Mon Sep 17 00:00:00 2001 From: Maru5er <74164821+Maru5er@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:00:25 -0700 Subject: [PATCH 3/3] Fix : removed na_action=ignore workaround for categorical data and import style --- pandas/core/apply.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/apply.py b/pandas/core/apply.py index 77faacc12e537..7e4f33f211ab9 100644 --- a/pandas/core/apply.py +++ b/pandas/core/apply.py @@ -38,9 +38,7 @@ is_numeric_dtype, is_sequence, ) -from pandas.core.dtypes.dtypes import ( - ExtensionDtype, -) +from pandas.core.dtypes.dtypes import ExtensionDtype from pandas.core.dtypes.generic import ( ABCDataFrame, ABCNDFrame,