Skip to main content
5 of 14
added 37 characters in body
kglr
  • 400.5k
  • 18
  • 488
  • 929

If we know tuples is constructed from 3 grids, we can extract the lengths using:

lF = Map[l |-> Total @ Normalize[#, Min] & @ GroupBy[#, #[[l]] &, Length]] &


ngrids = 3;

lengths = lF[tuples] @ Range[ngrids]
{6, 6, 5}

Then, we can use a combination of ArrayReshape and Extract to get the three grids:

reshaped = ArrayReshape[tuples, Append[Length @ First @ tuples] @ lengths];

positions = 
 Map[m |-> {Splice @ RotateRight[Append[All] @ Table[1, # - 1], m], m}] @ 
 Range[#] & @ ngrids;

Extract[reshaped, positions]

% == {grid1, grid2, grid3}
 True
kglr
  • 400.5k
  • 18
  • 488
  • 929