numpy.union1d()

numpy.union1d

numpy.union1d(ar1, ar2) [source]

Find the union of two arrays.

Return the unique, sorted array of values that are in either of the two input arrays.

Parameters:

ar1, ar2 : array_like

Input arrays. They are flattened if they are not already 1D.

Returns:

union1d : ndarray

Unique, sorted union of the inp