Consider the list:
list_1 = [
[
[1, 2, 3], [], [3, 4, 5], [], [4, 5, 6], [7, 8, 9], [9, 1, 0]
],
[
[0, 1, 2], [9, 0, 1], [], [0, 1, 3], [1, 1, 1], [9, 5, 6], [3, 6, 7]
],
[
[1, 2, 4], [4, 5, 6], [], [1, 0, 1], [0, 1, 1], [3, 9, 7], []
],
[
[1, 3, 4], [], [3, 5, 6], [], [], [], [0, 7, 0]
]
]
I want to remove a row if it contains empty list either at 1st , 3rd or 7th position.
For example above the 2nd and 3rd rows must be removed. I tried this:
list_2 = [sublist for sublist in list_1 if all(x for x in sublist)]
How I call the index 1, 3, 7 in this?