I essentially would like to do the opposite of this question. I have two matrixes that have been split with np.tril
or np.triu
and I want to recombine them into a single matrix.
A = array([[ 0. , 0. , 0. ],
[ 0.1, 0. , 0. ],
[ 0.6, 0.5, 0. ]])
B = array([[ 0. , 0.4, 0.8],
[ 0. , 0. , 0.3],
[ 0. , 0. , 0. ]])
And what I want it to look like is
array([[ 0. , 0.4, 0.8],
[ 0.1, 0. , 0.3],
[ 0.6, 0.5, 0. ]])
Is there an inbuilt numpy function to do this?