MCPcopy Create free account
hub / github.com/numpy/numpy / isin

Function isin

numpy/ma/extras.py:1331–1351  ·  view source on GitHub ↗

Calculates `element in test_elements`, broadcasting over `element` only. The output is always a masked array of the same shape as `element`. See `numpy.isin` for more details. See Also -------- in1d : Flattened version of this function. numpy.isin : Equivalen

(element, test_elements, assume_unique=False, invert=False)

Source from the content-addressed store, hash-verified

1329
1330
1331def isin(element, test_elements, assume_unique=False, invert=False):
1332 """
1333 Calculates `element in test_elements`, broadcasting over
1334 `element` only.
1335
1336 The output is always a masked array of the same shape as `element`.
1337 See `numpy.isin` for more details.
1338
1339 See Also
1340 --------
1341 in1d : Flattened version of this function.
1342 numpy.isin : Equivalent function for ndarrays.
1343
1344 Notes
1345 -----
1346 .. versionadded:: 1.13.0
1347
1348 """
1349 element = ma.asarray(element)
1350 return in1d(element, test_elements, assume_unique=assume_unique,
1351 invert=invert).reshape(element.shape)
1352
1353
1354def union1d(ar1, ar2):

Callers 1

test_isinMethod · 0.90

Calls 2

reshapeMethod · 0.80
in1dFunction · 0.70

Tested by 1

test_isinMethod · 0.72