[Numpy-discussion] Augmented matrix

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Nov 26 08:34:02 CST 2001


Nils Wagner <nwagner at mecha.uni-stuttgart.de> writes:

> How can I build an augmented matrix [A,b] in Numpy,
> where A is a m * n matrix (m>n) and b is a m*1 vector

AB = concatenate((A, b[:, NewAxis]), -1)

(assuming b is of rank 1)

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the Numpy-discussion mailing list