9951 explained code solutions for 126 technologies


python-numpyHow to extend Numpy array


import numpy as np
arr = np.array([1, 2])
arr = np.append(arr, 3)ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

np.append

append values to specified array

arr

array to append new value to

3

new value to append to array