Dropping list elements from nested list after evaluation
If you prefer using DeleteCases
,
list2 = DeleteCases[list1, _?(Abs[#[[3]]] == 1 &)]
{{1, 1, x, 2 x, 3 x}, {1, 1, -x, -2 x, -3 x}}
Delete[
list1,
Position[Abs[list1[[All, 3]]], 1]
]
{{1, 1, x, 2 x, 3 x}, {1, 1, -x, -2 x, -3 x}}
if you want to use Select
, try this
Select[list1,!NumberQ@#[[3]]||Abs[#[[3]]]!=1&]
{{1, 1, x, 2 x, 3 x}, {1, 1, -x, -2 x, -3 x}}