Skip to content

Commit 7d0ee96

Browse files
authored
REF: dont use compute_reduction (#34913)
1 parent 8020543 commit 7d0ee96

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

pandas/core/apply.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,7 @@ def apply_empty_result(self):
220220

221221
def apply_raw(self):
222222
""" apply to the values as a numpy array """
223-
result, reduction_success = libreduction.compute_reduction(
224-
self.values, self.f, axis=self.axis
225-
)
226-
227-
# We expect np.apply_along_axis to give a two-dimensional result, or raise.
228-
if not reduction_success:
229-
result = np.apply_along_axis(self.f, self.axis, self.values)
223+
result = np.apply_along_axis(self.f, self.axis, self.values)
230224

231225
# TODO: mixed type case
232226
if result.ndim == 2:

pandas/tests/frame/test_apply.py

-3
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,6 @@ def non_reducing_function(row):
745745
df.apply(func, axis=1)
746746
assert names == list(df.index)
747747

748-
@pytest.mark.xfail(
749-
reason="The 'run once' enhancement for apply_raw not implemented yet."
750-
)
751748
def test_apply_raw_function_runs_once(self):
752749
# https://github.com/pandas-dev/pandas/issues/34506
753750

0 commit comments

Comments
 (0)