Skip to content
Snippets Groups Projects
Commit b507e0b6 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

check if func is string befor hasattring it

parent 565dacb2
No related branches found
No related tags found
1 merge request!850Horizontal axis rolling
Pipeline #206830 passed with stages
in 4 minutes and 48 seconds
......@@ -201,7 +201,7 @@ def _hroll(
frame = pd.DataFrame(
views.reshape(views.shape[0], views.shape[1] * views.shape[2] * views.shape[3])
)
if hasattr(pd.DataFrame, func):
if isinstance(func, str) and hasattr(pd.DataFrame, func):
result = getattr(frame, func)(axis=1)
else:
result = frame.apply(func, axis=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment