jax.numpy.union1dΒΆ

jax.numpy.union1d(ar1, ar2)[source]ΒΆ

Find the union of two arrays.

LAX-backend implementation of union1d().

Original docstring below.

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

Parameters
  • ar1 (array_like) – Input arrays. They are flattened if they are not already 1D.

  • ar2 (array_like) – Input arrays. They are flattened if they are not already 1D.

Returns

union1d – Unique, sorted union of the input arrays.

Return type

ndarray