I have a list of pairs of coordinates, where some are missing.
coordinates = {
{{1, 1}, {1, 2}},
{{3, 4}, {5, 5}},
{{1, 2}, Missing[]},
{{9, 8}, {7, 7}},
{Missing[], {2, 3}}
}
I am trying to remove the pairs containing missing coordinates, to get
coordinates = {
{{1, 1}, {1, 2}},
{{3, 4}, {5, 5}},
{{9, 8}, {7, 7}},
}
I tried
coordinates = DeleteCases[coordinates, MemberQ[#, _Missing] &]
but that did not work. But the function MemberQ
works on pairs directly:
MemberQ[coordinates[[1]], _Missing] (* returns False *)
MemberQ[coordinates[[3]], _Missing] (* returns True *)
What did I do wrong?
DeleteCases[coordinates, _?(MemberQ[#, _Missing] &)]
orDeleteCases[coordinates, x_ /; MemberQ[x, _Missing]]
work $\endgroup$