Parameters ---------- a : array-like Input array with at least 1 dimension. out : ndarray, optional Alternate output array in which to place the result. The default is ``None``; if provided, it must have the same shape as the expected output and will
(a, out=None)
| 39 | |
| 40 | |
| 41 | def _nan_mask(a, out=None): |
| 42 | """ |
| 43 | Parameters |
| 44 | ---------- |
| 45 | a : array-like |
| 46 | Input array with at least 1 dimension. |
| 47 | out : ndarray, optional |
| 48 | Alternate output array in which to place the result. The default |
| 49 | is ``None``; if provided, it must have the same shape as the |
| 50 | expected output and will prevent the allocation of a new array. |
| 51 | |
| 52 | Returns |
| 53 | ------- |
| 54 | y : bool ndarray or True |
| 55 | A bool array where ``np.nan`` positions are marked with ``False`` |
| 56 | and other positions are marked with ``True``. If the type of ``a`` |
| 57 | is such that it can't possibly contain ``np.nan``, returns ``True``. |
| 58 | """ |
| 59 | # we assume that a is an array for this private function |
| 60 | |
| 61 | if a.dtype.kind not in 'fc': |
| 62 | return True |
| 63 | |
| 64 | y = np.isnan(a, out=out) |
| 65 | y = np.invert(y, out=y) |
| 66 | return y |
| 67 | |
| 68 | def _replace_nan(a, val): |
| 69 | """ |
no outgoing calls