Is it posible to make de union between two matrices in python? I mean to have in one matrix all the elements from other two matrices without reapiting any of them. For example, if we have:
A = [[1,2],[3,4],[5,6]]
B = [[5,6],[7,8]]
The union would be C = [[1,2],[3,4],[5,6],[7,8]]
There is a numpy command for arrays: np.union1d
but I cannot find any for matrices. I just have found np.concatenate
and np.vstack
but they write twice the repeated elements.