numpy.ma.append() function append the values to the end of an array.
Syntax : numpy.ma.append(arr1, arr2, axis = None)
arr1 : [array_like] Values are appended to a copy of this array.
arr2 : [array_like] Values are appended to a copy of this array. If axis is not specified, arr2 can be any shape and will be flattened before use. Otherwise, it must be of the correct shape.
axis : [int, optional] The axis along which value are appended.
Return : [MaskedArray] A copy of arr1 with arr2 appended to axis. If axis is None, the result is a flattened array.
Code #1 :
[1 2 -- 4 5 6 7 -- 9]
Code #2 :
[1 -- 3 4 5 6 7 -- 9 10]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course