I have a list/array like so:
{{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}, ... }}
I want to remove the curly brackets around each element (so I can use ListDensityPlot) so that I have:
{{1, 2, 3, 4, 5, 6}, {7, 8, 9, ...}}
I have a list/array like so:
{{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}, ... }}
I want to remove the curly brackets around each element (so I can use ListDensityPlot) so that I have:
{{1, 2, 3, 4, 5, 6}, {7, 8, 9, ...}}
list = {{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}}};
Flatten /@ list
{{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10}}
Or use the operator form
Map[Flatten] @ list
Just to put my comment on record, I propose
{{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}}}[[All, All, 1]]
which gives
{{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10}}
Given your list as:
list = {{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}}};
Use Flatten to remove the inner brackets.
Flatten /@ list
Which gives:
{{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10}}
Flatten[{{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}}}, {{1}, {2, 3}}]. (Pretty sure this is a dupe...) – J. M.'s missing motivation Jul 31 '17 at 16:34Flatten /@ {{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}}}– ktm Jul 31 '17 at 16:40{{{1}, {2}, {3}, {4}, {5}, {6}}, {{7}, {8}, {9}, {10}}}[[All, All, 1]]– m_goldberg Jul 31 '17 at 17:20