Concatenate a sequence of arrays along the given axis.
The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).
The axis along which the arrays will be joined. Default is 0.
The concatenated array with any masked entries preserved.
See also
numpy.concatenateEquivalent function in the top-level NumPy module.
>>> import numpy as np
>>> import numpy.ma as ma
>>> a = ma.arange(3)
>>> a[1] = ma.masked
>>> b = ma.arange(2, 5)
>>> a
masked_array(data=[0, --, 2],
mask=[False, True, False],
fill_value=999999)
>>> b
masked_array(data=[2, 3, 4],
mask=False,
fill_value=999999)
>>> ma.concatenate([a, b])
masked_array(data=[0, --, 2, 2, 3, 4],
mask=[False, True, False, False, False, False],
fill_value=999999)
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ma.concatenate.html