Computational Physics, Python, Linear Algebra, Math, Mathematics.
1) y = y.reshape(100, 1) We will create the matrix A from x by adding a column of ones exactly like we did in the example 3. A = np.hstack((x, np.ones(np.shape(x)))) A[:10] array([[3.48234593, 1. ], [1.43069667, 1. ], [1.13425727, 1. ], [2.75657385, 1. ], [3.59734485, 1. ], [2.1155323 , 1. ],