On this page
numpy.ma.append
ma.append(a, b, axis=None)[source]- 
    
Append values to the end of an array.
New in version 1.9.0.
- Parameters
 - 
      
aarray_like- 
        
Values are appended to a copy of this array.
 barray_like- 
        
These values are appended to a copy of
a. It must be of the correct shape (the same shape asa, excludingaxis). Ifaxisis not specified,bcan be any shape and will be flattened before use. axisint, optional- 
        
The axis along which
vare appended. Ifaxisis not given, bothaandbare flattened before use. 
 - Returns
 - 
      
appendMaskedArray- 
        
A copy of
awithbappended toaxis. Note thatappenddoes not occur in-place: a new array is allocated and filled. Ifaxisis None, the result is a flattened array. 
 
See also
numpy.append- 
       
Equivalent function in the top-level NumPy module.
 
Examples
>>> import numpy.ma as ma >>> 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) 
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
 https://numpy.org/doc/1.20/reference/generated/numpy.ma.append.html