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

Function union1d

numpy/ma/extras.py:1354–1365  ·  view source on GitHub ↗

Union of two arrays. The output is always a masked array. See `numpy.union1d` for more details. See Also -------- numpy.union1d : Equivalent function for ndarrays.

(ar1, ar2)

Source from the content-addressed store, hash-verified

1352
1353
1354def union1d(ar1, ar2):
1355 """
1356 Union of two arrays.
1357
1358 The output is always a masked array. See `numpy.union1d` for more details.
1359
1360 See Also
1361 --------
1362 numpy.union1d : Equivalent function for ndarrays.
1363
1364 """
1365 return unique(ma.concatenate((ar1, ar2), axis=None))
1366
1367
1368def setdiff1d(ar1, ar2, assume_unique=False):

Callers 1

test_union1dMethod · 0.90

Calls 1

uniqueFunction · 0.70

Tested by 1

test_union1dMethod · 0.72