Total beginner on Python here, and all I want to do is add a column of 1s to a matrix, and I cannot seem to accomplish it. I wanted the new column to be the first one of the matrix. What I have tried:
import numpy as np
a = np.random.random((4, 4))
for i in range(len(a)):
a[i] = [1] + a[i]
But apparently that just adds 1 to every element in my matrix. I am using Python3