Skip to main content

np.append()

np.append(arr, value)

Returns a copy of arr with value appended at the end. This does not change arr unless you store the result in arr.

Input:
arr : array
The original array to which a value will be appended.
value : any type
The value to append to the array.
Returns:
A new array containing the elements of the original array followed by the appended value
Return Type:
array

np.append(weight_arr, 2)

array([40. , 1.5 , 15. , 80. , 25. , 1. , 0.25, 10. , 2. ])