import numpy # Say y is y = numpy.array([1,2,3]) Y = numpy.vstack([y,y,y,y]) # Y is array([[1, 2, 3], # [1, 2, 3], # [1, 2, 3], # [1, 2, 3]])
x = numpy.array([[0],[2],[4],[6]]) # a column-vector of your scalars x0, x1... Y - x Hope this is what you meant. cheers, Samuel On 06.10.2011, at 14:08, Neal Becker wrote: > Given a vector y, I want a matrix H whose rows are > > y - x0 > y - x1 > y - x2 > ... > > > where x_i are scalars _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion