>>> x1 array([[ 0., -1., 2.], [ 3., -4., 2.], [ -2., 1., -8.]]) >>> x3 array([[ 0., -5., 2.], [ 3., 0., -3.], [ 3., 2., 8.]]) I need two matricies to be output: S and T, such that X is the sum of all positive values in X and Y, and T is the sum of all negative values in X and Y.
For example:
S = array([ [ 0., 0., 4.], [ 6., 0., 2.], [ 3., 3., 8.]]) T = array([ [ 0., -6., 0.], [ 0., -4., -3.], [ -2., 0., -8.]]) I am using Python 2.6.7.
posArrayandnegArrayif S[0][2] were-2?