4

I guess this is a fairly simple question, but I haven't had much luck with using Join[...] or Transpose[...]. I have two data sets which are multi-column lists, I simply want to turn them into one multi-column data set.

ListA = {{α, β, γ}, {1, 2, 3}, {4, 5, 6}};
ListB = {{δ, ϵ, ϕ}, {7, 8, 9}, {10, 11, 12}};

ListC = {
  {α, β, γ, δ, ϵ, ϕ}, 
  {1, 2, 3, 7, 8, 9}, 
  {4, 5, 6, 10, 11, 12}
};

If ListA and ListB are the two starting files and ListC is the desired form. So I simply want to stitch ListB to the right of ListA.

Kuba
  • 136,707
  • 13
  • 279
  • 740
user27119
  • 2,500
  • 13
  • 34

2 Answers2

4
ArrayFlatten[{{ListA, ListB}}]

{{α, β, γ, δ, ϵ, ϕ}, {1, 2, 3, 7, 8, 9}, {4, 5, 6, 10, 11, 12}}

kglr
  • 394,356
  • 18
  • 477
  • 896
3
Flatten[#] & /@ Transpose[{listA, listB}]

or

Transpose[{listA, listB}] /. {{a___}, {b___}} -> {a, b}
Alucard
  • 2,639
  • 13
  • 22