I have an numpy array that has 3 rows and 3 columns .Like this:
100 200 300
233 699 999
566 655 895
and I want to create a numpy array like this for my linear regression:
100 200 300 1
233 699 999 1
566 655 895 1
This my code:
X=np.hstack((x[:,0]),x[:,1]),x[:,2]) ,np.ones(x.shape[0])))
Please how can I edit my code to get my target?
x
apart inhstack
ones
because the 1-dimension shape arrays are not what you expect.