Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pandas/core/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/frame/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down