I have two lists-of-lists which can be schematically summarized by this:
a = {{1}, {2}, {3}};
b = {{4}, {5}, {6}};
I want to combine them into a single list of lists, with each element at the same level, ala:
{{1}, {2}, {3}, {4}, {5}, {6}}
Except I cannot for the life of me make it happen. The most obvious thing looks like:
In[537]:= Append[a, b]
Out[537]= {{1}, {2}, {3}, {{4}, {5}, {6}}}
Which isn’t what I want. The Append documentation doesn’t seem to cover a case like this, and I can get no amount of Appending and Flattening to work. I suppose I could write a for loop and just keep adding to an empty list, but good god is that clumsy. There must be an elegant way to do it?
Change your code from:
to: