Error in overwriting zeros array "could not broadcast input array from shape (8,1) into shape (8,)"

126 Views Asked by At
import numpy as np
          
x0 = [1, 2, 3, 4, 5, 6, 7, 8]
xx = np.zeros((8, 20))
xx[:,0] = x0 

I want to overwrite zero arrays columns but it gives an error as:

could not broadcast input array from shape (8,1) into shape (8,)

0

There are 0 best solutions below