Let a
be a list of lists like this:
a= {{"apples", "pears", 1, 17},
{"pineapples", "apples", 5, 7},
{"yes", "building", 4, 7}}
How can I make a list b
containing only elements of a
for which the nth element meets an arbitrary criterion?
Let us say for example that n is 3 and the criterion is "must be greater than 2". Then b
would be
{{"pineapples", "apples", 5, 7},
{"yes", "building", 4, 7}}.