What is the most efficient method for deleting a row of empty list elements? For example, here is a list with one row of empty list elements:
list = {{
{1, 2, 3},
{0, 0, 0},
{4, 5, 6}
},
{{}, {}, {}},
{
{1, 2, 3},
{0, 0, 0},
{4, 5, 6}
}};
I want to get rid of the whole of row 2. Using DeleteCases[]
:
DeleteCases[list, x_ /; x == {}, Infinity]
...which returns:
{{{1, 2, 3}, {0, 0, 0}, {4, 5, 6}}, **{}**, {{1, 2, 3}, {0, 0, 0}, {4, 5,
6}}}
How can I efficiently delete the 2nd row without using DeleteCases[]
twice?
DeleteCases[list, {{} ..}]
$\endgroup$DeleteCases[list, {{}, {}, {}}]
in your example. $\endgroup$