I want to concatenate these two arrays
a = np.array([[1,2,3],[3,4,5],[6,7,8]])
b = np.array([9,10,11])
such that
a = [[1,2,3,9],[3,4,5,10],[6,7,8,11]]
Tried using concatenate
for i in range(len(a)):
a[i] = np.concatenate(a[i],[b[i]])
Got an error:
TypeError: 'list' object cannot be interpreted as an integer
Tried using append
for i in range(len(a)):
a[i] = np.append(a[i],b[i])
Got another error:
ValueError: could not broadcast input array from shape (4,) into shape (3,)
(New to stackoverflow, sorry if I didn't format this well)