numpy.union1d

numpy.union1d(ar1, ar2)

Union of 1D arrays with unique elements.

Use unique1d() to generate arrays with only unique elements to use as inputs to this function.

Parameters:

ar1 : array_like, shape(M,)

Input array.

ar2 : array_like, shape(N,)

Input array.

Returns:

union : ndarray

Unique union of input arrays.

See also

numpy.lib.arraysetops
Module with a number of other functions for performing set operations on arrays.

Previous topic

numpy.setxor1d

Next topic

Window functions

This Page

Quick search