1
$\begingroup$

In order to get list x4 from list x1, I used three operations. How to get list x4 in one operation or as simple as possible?

ClearAll["Global`*"]

x1 = {{{7, -1.5}, {7, 0.2}, {7, -0.2}, {7, 1}, {7, 
     0.08}, {7, -0.0}, {7, 0.4}, {7, -0.2}, {7, 2}, {7, 
     3}}, {{-8, -1.9}, {-8, 0.3}, {-8, -0.2}, {-8, -0.1}, {-8, 
     2}, {-8, -0.0}, {-8, 4}, {-8, 7}, {-8, 1}, {-8, 6}}, {{-1, 
     2.5}, {-1, -0.3}, {-1, 0.2}, {-1, 
     0.1}, {-1, -0.0}, {-1, -0.05}, {-1, 3}, {1, 7}, {-1, 5}, {1, 
     1}}, {{5, -2.7}, {5, 0.3}, {5, -0.2}, {5, 2}, {5, 7}, {5, 8}, {5,
      3}, {5, 6}, {5, 1}, {5, 1}}};

x2 = Flatten[x1, {2, 1}]

x3 = Partition[x2, {4, 2}]

x4 = Flatten[x3, 1]
$\endgroup$

1 Answer 1

9
$\begingroup$
Flatten[x1, {{2, 1, 3}}]
% == x4
(* True *)

For the edited question:

Transpose@x1
$\endgroup$
1
  • $\begingroup$ Thanks! I'm sorry, I made mistakes when I wrote the question, it's edited. $\endgroup$
    – Mam Mam
    Jun 4 at 11:55

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