def delete_masked_points(*args):
if not len(args):<EOL><INDENT>return ()<EOL><DEDENT>if (is_string_like(args[<NUM_LIT:0>]) or not iterable(args[<NUM_LIT:0>])):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>nrecs = len(args[<NUM_LIT:0>])<EOL>margs = []<EOL>seqlist = [False] * len(args)<EOL>for i, x in enumerate(args):<EOL><INDENT>if (not is_string_like(x)) and iterable(x) and len(x) == nrecs:<EOL><INDENT>seqlist[i] = True<EOL>if ma.isMA(x):<EOL><INDENT>if x.ndim > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>x = np.asarray(x)<EOL><DEDENT><DEDENT>margs.append(x)<EOL><DEDENT>masks = []    <EOL>for i, x in enumerate(margs):<EOL><INDENT>if seqlist[i]:<EOL><INDENT>if x.ndim > <NUM_LIT:1>:<EOL><INDENT>continue  <EOL><DEDENT>if ma.isMA(x):<EOL><INDENT>masks.append(~ma.getmaskarray(x))  <EOL>xd = x.data<EOL><DEDENT>else:<EOL><INDENT>xd = x<EOL><DEDENT>try:<EOL><INDENT>mask = np.isfinite(xd)<EOL>if isinstance(mask, np.ndarray):<EOL><INDENT>masks.append(mask)<EOL><DEDENT><DEDENT>except: <EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>if len(masks):<EOL><INDENT>mask = reduce(np.logical_and, masks)<EOL>igood = mask.nonzero()[<NUM_LIT:0>]<EOL>if len(igood) < nrecs:<EOL><INDENT>for i, x in enumerate(margs):<EOL><INDENT>if seqlist[i]:<EOL><INDENT>margs[i] = x.take(igood, axis=<NUM_LIT:0>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for i, x in enumerate(margs):<EOL><INDENT>if seqlist[i] and ma.isMA(x):<EOL><INDENT>margs[i] = x.filled()<EOL><DEDENT><DEDENT>return margs<EOL>
Find all masked and/or non-finite points in a set of arguments,
and return the arguments with only the unmasked points remaining.

Arguments can be in any of 5 categories:

1) 1-D masked arrays
2) 1-D ndarrays
3) ndarrays with more than one dimension
4) other non-string iterables
5) anything else

The first argument must be in one of the first four categories;
any argument with a length differing from that of the first
argument (and hence anything in category 5) then will be
passed through unchanged.

Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf.  No attempt is made to
extract a mask from categories 2, 3, and 4 if :meth:`np.isfinite`
does not yield a Boolean array.

All input arguments that are not passed unchanged are returned
as ndarrays after removing the points or rows corresponding to
masks in any of the arguments.

A vastly simpler version of this function was originally
written as a helper for Axes.scatter().