From a874c4680a477a2fd8d0077725db29dbb7d7ccbb Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 20 Jun 2020 10:01:51 -0700 Subject: [PATCH] REF: dont use compute_reduction --- pandas/core/apply.py | 8 +------- pandas/tests/frame/test_apply.py | 3 --- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pandas/core/apply.py b/pandas/core/apply.py index 0a274d8becd72..90cb0e2e1be4c 100644 --- a/pandas/core/apply.py +++ b/pandas/core/apply.py @@ -220,13 +220,7 @@ def apply_empty_result(self): def apply_raw(self): """ apply to the values as a numpy array """ - result, reduction_success = libreduction.compute_reduction( - self.values, self.f, axis=self.axis - ) - - # We expect np.apply_along_axis to give a two-dimensional result, or raise. - if not reduction_success: - result = np.apply_along_axis(self.f, self.axis, self.values) + result = np.apply_along_axis(self.f, self.axis, self.values) # TODO: mixed type case if result.ndim == 2: diff --git a/pandas/tests/frame/test_apply.py b/pandas/tests/frame/test_apply.py index 48a141a657cbb..8f0d3d9fbc734 100644 --- a/pandas/tests/frame/test_apply.py +++ b/pandas/tests/frame/test_apply.py @@ -745,9 +745,6 @@ def non_reducing_function(row): df.apply(func, axis=1) assert names == list(df.index) - @pytest.mark.xfail( - reason="The 'run once' enhancement for apply_raw not implemented yet." - ) def test_apply_raw_function_runs_once(self): # https://github.com/pandas-dev/pandas/issues/34506