I want to make two matrices same dimension/shape padding with zeros..
for e.g. I have
>>> x array([[ 1., -1., 1.], [ 1., 1., - 1.]]) >>> >>> >>> y array([[ 2., 2.], [ 2., 2.], [ -2., 2.]]) Output I want
x1 = array([[ 1., -1., 1.], [ 1., 1., -1.], [ 0., 0., 0.]]) y1 =array([[ 2., 2., 0.], [ 2., 2., 0.], [ -2., 2., 0.]]) any help? I looked up the "pad" but the numpy version we are using is older so it does not have pad. ( numpy ver. 1.6.x)
I also looked up some solutions but they are specific to shape, in my case the shape is dynamic -- and the operation needs to be fast -- as I do this over a large matrices and many times