def _nanpercentile_1d(values, mask, q, na_value, interpolation):
<EOL>values = values[~mask]<EOL>if len(values) == <NUM_LIT:0>:<EOL><INDENT>if lib.is_scalar(q):<EOL><INDENT>return na_value<EOL><DEDENT>else:<EOL><INDENT>return np.array([na_value] * len(q),<EOL>dtype=values.dtype)<EOL><DEDENT><DEDENT>return np.percentile(values, q, interpolation=interpolation)<EOL>
Wraper for np.percentile that skips missing values, specialized to
1-dimensional case.

Parameters
----------
values : array over which to find quantiles
mask : ndarray[bool]
    locations in values that should be considered missing
q : scalar or array of quantile indices to find
na_value : scalar
    value to return for empty or all-null values
interpolation : str

Returns
-------
quantiles : scalar or array