I have 3 lists
> a= ones((10,1))
>
>
> x_1=[1,2,3,4...,10] (i.e. list of 10 elements)
>
> y_1=[2,1,4,7,2,..20] (list of 10 elements)
I want to join these 3 list and make it as 2d list or matrix as:
> mat=[a x_1 y_1]
like in MATLAB where a will be 1 column x_1 second column and y_1 third column.
> mat= [[1,1,2],[1,2,1],[1,3,4],[]......[]]
I tried
> np.matrix([[a,[[i] for i in x_1],[[i] for i in y_1]]])
but it gave an error as matrix must be 2 dimensionl
How can I do this ?
Also, if I have 2D arrays i.e.
> a=np.ones((3,2))
>
> x_1=[[1,2],[2,3],[2,4]]
>
> y_1=[[3,4],[5,6],[3,4]]
Then how can I concatenate these arrays and make it as
> c=[[1,1,2,3,4],[1,2,3,5,6],[1,2,4,3,4]]
In matlab it is written as:
> c=[a,x_1,y_1]
How can I do this as well?
ais a 2D python array.