apend numpy array code example Example: append value to numpy array x = np.random.randint(2, size=10) x = np.append(x, 2)