[Numpy-discussion] Combining arrays together

Alan G Isaac aisaac at american.edu
Sun Jul 2 23:04:48 CDT 2006


On Mon, 3 Jul 2006, Bill Baxter apparently wrote: 
> What's the best way to combine say several 2-d arrays 
> together into a grid? 


>>> help(N.bmat)
Help on function bmat in module numpy.core.defmatrix:

bmat(obj, ldict=None, gdict=None)
    Build a matrix object from string, nested sequence, or array.

    Ex:  F = bmat('A, B; C, D')
         F = bmat([[A,B],[C,D]])
         F = bmat(r_[c_[A,B],c_[C,D]])

        all produce the same Matrix Object    [ A  B ]
                                              [ C  D ]

        if A, B, C, and D are appropriately shaped 2-d arrays.

hth,
Alan Isaac







More information about the Numpy-discussion mailing list