Skip to content

DEPR: raise deprecation warning in numpy ufuncs on DataFrames if not aligned + fallback to <1.2.0 behaviour #39239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
jorisvandenbossche committed Jan 19, 2021
commit 4dcde0e65d3285ab7a8f7e2f83f68b0f4a606691
8 changes: 4 additions & 4 deletions pandas/core/arraylike.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _maybe_fallback(ufunc: Callable, method: str, *inputs: Any, **kwargs: Any):
"or align manually (eg 'df1, df2 = df1.align(df2)') before passing to "
"the ufunc to obtain the future behaviour and silence this warning.",
FutureWarning,
stacklevel=3,
stacklevel=4,
)

# keep the first dataframe of the inputs, other DataFrame/Series is
Expand All @@ -223,9 +223,9 @@ def _maybe_fallback(ufunc: Callable, method: str, *inputs: Any, **kwargs: Any):

# call the ufunc on those transformed inputs
return getattr(ufunc, method)(*new_inputs, **kwargs)
else:
# signal that we didn't fallback / execute the ufunc yet
return NotImplemented

# signal that we didn't fallback / execute the ufunc yet
return NotImplemented


def array_ufunc(self, ufunc: Callable, method: str, *inputs: Any, **kwargs: Any):
Expand Down