2d matrix composed from 1d matrices in python
Question: A newbie question and possible duplicate: How can one compose a matrix in
numpy using arrays or 1d matrices? In matlab, I would use following syntax for
the matrix consisting of three arrays treated as rows:

    
    
    A=[1; 1; 1];
    B=[2; 2; 2];
    C=[3; 3; 3];
    D=[A B C]
    

The result is:

    
    
    D =
    
     1     2     3
     1     2     3
     1     2     3
    

Thank you


Answer: You should do

    
    
    import numpy as np
    A = np.array([1, 1, 1])
    B = np.array([2, 2, 2])
    C = np.array([3, 3, 3])
    D = np.vstack((A, B, C))
    

See [NumPy for MATLAB users](http://mathesaurus.sourceforge.net/matlab-
numpy.html) (official link seems to be down)

