ma.append(a, b, axis=None)
Append values to the end of an array.
Parameters:aarray_likeValues are appended to a copy of this array.
barray_likeThese values are appended to a copy of a. It must be of the correct shape (the same shape as a, excluding axis). If axis is not specified, b can be any shape and will be flattened before use.
axisint, optionalThe axis along which v are appended. If axis is not given, both a and b are flattened before use.
Returns:appendMaskedArrayA copy of a with b appended to axis. Note that
does not occur in-place: a new array is allocated and filled. If axis is None, the result is a flattened array.
See also
Equivalent function in the top-level NumPy module.
Examples
>>> importnumpyasnp>>> importnumpy.maasma>>> a=ma.masked_values([1,2,3],2)>>> b=ma.masked_values([[4,5,6],[7,8,9]],7)>>> ma.append(a,b)masked_array(data=[1, --, 3, 4, 5, 6, --, 8, 9], mask=[False, True, False, False, False, False, True, False, False], fill_value=999999)