This is a pre-release version (2.5.0.dev0+git20251130.2de293a).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ma / extras / union1d

function

numpy.ma.extras:union1d

source: build-install/usr/lib/python3.14/site-packages/numpy/ma/extras.py:1463

Signature

def union1d(ar1, ar2)

Summary

Union of two arrays.

Extended Summary

The output is always a masked array. See numpy.union1d for more details.

Examples

import numpy as np
ar1 = np.ma.array([1, 2, 3, 4])
ar2 = np.ma.array([3, 4, 5, 6])
✓
np.ma.union1d(ar1, ar2)
✗
masked_array(data=[1, 2, 3, 4, 5, 6],
             mask=False,
       fill_value=999999)

See also

numpy.union1d

Equivalent function for ndarrays.

Aliases

  • numpy.ma.union1d