2
$\begingroup$

I have two tables that look something like-

39.3278 2990.3 4503.98 0 -1859.37
35.7833 3014.8 1281.98 0 -3497.95

and

0.0255 28.6 -9.954 -2.612
0.0724 28.7 -1.031 -1.435

I am trying to generate a grand table by joining these two tables that should look something like this-

39.3278 2990.3 4503.98 0 -1859.37 0.0255 28.6 -9.954 -2.612
35.7833 3014.8 1281.98 0 -3497.95 0.0724 28.7 -1.031 -1.435

The code that I am using is-

data1 = {{39.3278, 2990.3, 4503.98, 0, -1859.37}, {35.7833, 3014.8, 
1281.98, 0, -3497.95}};
data2 = {{0.0255, 28.6, -9.954, -2.612}, {0.0724, 
28.7, -1.031, -1.435}};
data = Transpose@Join[Transpose@data1, data2];
TableForm[data]

But above code is showing the error that levels can not be transposed. What is the possible solution to this problem?

$\endgroup$
1
  • $\begingroup$ At least closely related: 103834, 67423 $\endgroup$
    – Kuba
    May 21, 2017 at 19:44

1 Answer 1

4
$\begingroup$
d1 = {{39.3278`, 2990.3`, 4503.98`, 0, -1859.37`}, {35.7833`, 3014.8`, 1281.98`, 
    0, -3497.95`}};
d2 = {{0.0255`, 28.6`, -9.954`, -2.612`}, {0.0724`, 28.7`, -1.031`, -1.435`}};

Join[d1, d2, 2]
{{39.3278, 2990.3, 4503.98, 0, -1859.37, 0.0255, 28.6, -9.954, -2.612},
 {35.7833, 3014.8, 1281.98, 0, -3497.95, 0.0724, 28.7, -1.031, -1.435}}
$\endgroup$
5
  • $\begingroup$ mathematica.stackexchange.com/q/121522/5478 $\endgroup$
    – Kuba
    May 21, 2017 at 20:08
  • $\begingroup$ @Kuba Hm... I did not mean to be capricious. I did not remember that instance. Recommended action? $\endgroup$
    – Mr.Wizard
    May 21, 2017 at 20:12
  • $\begingroup$ I know, happens to me too. Don't know yet, this surely has be asked many times and will be, maybe we should think about some cleaning in list-manipulation faqs. Since "elegant operations" is already a multiquestion guideline maybe it would not harm to add some more common activities. $\endgroup$
    – Kuba
    May 21, 2017 at 21:19
  • $\begingroup$ Duplicate from early 2012: mathematica.stackexchange.com/questions/189/… $\endgroup$ May 21, 2017 at 22:51
  • $\begingroup$ @Mike That is not a simple duplicate however, unfortunately. Yes, an answer exists within but not one that is likely to be noticed and understood by a beginner as it is complicated by the need to convert rows to columns. It is the first Q&A I linked from (121522) but there too I did not think it an ideal duplicate as I did not mark that one as such. $\endgroup$
    – Mr.Wizard
    May 22, 2017 at 6:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.