Imagine we have a list with some hierarchical structure:
list = {{{2,3},{2,4}},{{{3,4}}},{{5,6},{7,8}}};
Which we then flatten to some level in order to process the data points:
Flatten[list,1]
>> {{2, 3}, {2, 4}, {3, 4}, {5, 6}, {7, 8}}
We then do "something" to change the value of the elements in the list, without increasing or decreasing the number of elements:
>> {{5*10^9, 3}, {2, 4}, {3, 4}, {191991, 6}, {7, 8}}
Can we reverse the flattening procedure to go back to a list of the form:
>> {{{5*10^9,3},{2,4}},{{{3,4}}},{{191991,6},{7,8}}};
Partitionis essentially the inverse ofFlatten– bill s Aug 14 '13 at 00:44Internal-Deflattenis also a candidate for the inverse ofFlatten, and is worth mentioning :). See Szabolcs answer in the Q&A about undocumented functions. But yeah I guess it doesn't really help. – Jacob Akkerboom Aug 17 '13 at 21:26ArrayReshape? – Valerio Nov 03 '17 at 14:29