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)
| 1329 | |
| 1330 | |
| 1331 | def 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 | |
| 1354 | def union1d(ar1, ar2): |