[EMAIL PROTECTED] wrote: > hi > i am looking for an efficient way to get a specific column of a > numpy.matrix .. > also i want to set a column of the matrix with a given set of > values ..i couldn't find any methods for this in matrix doc..do i have > to write the functions from scratch? > > TIA > dn >
>>> from numpy import matrix >>> x=matrix([[1,2,3],[4,5,6],[7,8,9]]) >>> x[:,1] matrix([[2], [5], [8]]) >>> x[:,1].transpose() matrix([[2, 5, 8]]) >>> matrix([11,12,13]).transpose() matrix([[11], [12], [13]]) >>> x[:,1] = matrix([11,12,13]).transpose() >>> x matrix([[ 1, 11, 3], [ 4, 12, 6], [ 7, 13, 9]]) -- http://mail.python.org/mailman/listinfo/python-list