Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

merge lists of lists

I realize that if I have two lists, say

l1 = [1,2,3]
l2 = [4,5,6]

then I can join them via

l1 + l2

i.e. this gives [1,2,3,4,5,6].

I want to know how to do this when my list is not a list of numbers, but a list of matrices. I imagine it would be the same for a list of lists but I don't know how to do that either.

merge lists of lists

I realize that if I have two lists, say

l1 = [1,2,3]
l2 = [4,5,6]

then I can join them via

l1 + l2

i.e. this gives [1,2,3,4,5,6].

I want to know how to do this when my list is not a list of numbers, but a list of matrices. I imagine it would be the same for a list of lists but I don't know how to do that either.

Also, I realize I can accomplish this by making the matrices immutable. But I still want to be able to multiply them. How do I treat a list of matrices as a list of matrices in an ordinary mathematical way?

merge lists of lists

I realize that if I have two lists, say

l1 = [1,2,3]
l2 = [4,5,6]

then I can join them via

l1 + l2

i.e. this gives [1,2,3,4,5,6].

I want to know how to do this when my list is not a list of numbers, but a list of matrices. I imagine it would be the same for a list of lists but I don't know how to do that either.

Also, I realize I can accomplish this by making the matrices immutable. But I still want to be able to multiply them. How do I treat a list of matrices as a list of matrices in an ordinary mathematical way?