8000 API: Cleaning `numpy/__init__.py` and main namespace - Part 4 [NEP 52] by mtsokol · Pull Request #24445 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

API: Cleaning numpy/__init__.py and main namespace - Part 4 [NEP 52] #24445

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
merged 9 commits into from
Sep 5, 2023
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
Remove redundant variable
  • Loading branch information
mtsokol committed Sep 5, 2023
commit bf91c882dbc3d15d8caef2227c3b87e0e3c3074a
8 changes: 3 additions & 5 deletions numpy/lib/_arraysetops_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,8 @@ def isin(element, test_elements, assume_unique=False, invert=False, *,
[ True, False]])
"""
element = np.asarray(element)
result = _in1d(element, test_elements, assume_unique=assume_unique,
invert=invert, kind=kind).reshape(element.shape)
return result
return _in1d(element, test_elements, assume_unique=assume_unique,
invert=invert, kind=kind).reshape(element.shape)


def _union1d_dispatcher(ar1, ar2):
Expand Down Expand Up @@ -968,5 +967,4 @@ def setdiff1d(ar1, ar2, assume_unique=False):
else:
ar1 = unique(ar1)
ar2 = unique(ar2)
result = ar1[_in1d(ar1, ar2, assume_unique=True, invert=True)]
return result
return ar1[_in1d(ar1, ar2, assume_unique=True, invert=True)]
0