Ask Your Question
1

merge lists of lists

asked 9 years ago

j0equ1nn gravatar image

updated 9 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 9 years ago

nbruin gravatar image

just use + as well. Python doesn't care what's in lists when it concatenates them.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 1,238 times

Last updated: Apr 02 '16