I wrote a code to populate a matrix with 0 or 1 randomly. But it ended in 4-5 lines. I want it to be in 1 line.
pop_size = (8,10)
initial_pop = np.empty((pop_size))
for i in range(pop_size[0]):
for j in range(pop_size[1]):
initial_pop[i][j] = rd.randint(0,1)