/usr/local/lib64/python3.6/site-packages/numpy/lib/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/numpy/lib/__pycache__/nanfunctions.cpython-36.pyc (54460B)
3
Eg @ s d Z ddlZddlZddlZddlmZ ddlmZ ej ej
ddZ
ddd d
ddd
dddddddgZdWddZdd Z
dd ZdXddZdYddZdZd d!Ze
eddejfd"d Zd[d#d$Ze
eddejfd%dZd\d&d'Ze
ed]d(dZd^d)d*Ze
ed_d+d
Zd`d,d-Ze
edddejfd.dZdad/d0Ze
edddejfd1dZdbd2d3Ze
edcd4dZddd5d6Z e
e ded7dZ!dfd8d9Z"e
e"dddejfd:dZ#dgd;d<Z$dhd=d>Z%did?d@Z&djdAdBZ'e
e'dddejfdCd
Z(dkdDdEZ)e
e)ddddFejfdGdZ*dldHdIZ+e
e+ddddFejfdJdZ,ddddFejfdKdLZ-dmdMdNZ.dndOdPZ/dodQdRZ0e
e0ddddejfdSdZ1dpdTdUZ2e
e2ddddejfdVdZ3dS )qa
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nancumsum` -- cumulative sum of non-NaN values
- `nancumprod` -- cumulative product of non-NaN values
- `nanmean` -- mean of non-NaN values
- `nanvar` -- variance of non-NaN values
- `nanstd` -- standard deviation of non-NaN values
- `nanmedian` -- median of non-NaN values
- `nanquantile` -- qth quantile of non-NaN values
- `nanpercentile` -- qth percentile of non-NaN values
N)
function_base) overridesnumpy)modulenansumnanmaxnanmin nanargmax nanargminnanmean nanmedian
nanpercentilenanvarnanstdnanprod nancumsum
nancumprodnanquantilec C s0 | j jdkrdS tj| |d}tj||d}|S )ap
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 prevent the allocation of a new array.
Returns
-------
y : bool ndarray or True
A bool array where ``np.nan`` positions are marked with ``False``
and other positions are marked with ``True``. If the type of ``a``
is such that it can't possibly contain ``np.nan``, returns ``True``.
ZfcT)out)dtypekindnpisnaninvert)ar y r B/usr/local/lib64/python3.6/site-packages/numpy/lib/nanfunctions.py _nan_mask) s
r c C sx t j| } | jt jkr(t j| | td}n t| jjt jrDt j | }nd}|dk rpt j
| ddd} t j| ||d | |fS )a
If `a` is of inexact type, make a copy of `a`, replace NaNs with
the `val` value, and return the copy together with a boolean mask
marking the locations where NaNs were present. If `a` is not of
inexact type, do nothing and return `a` together with a mask of None.
Note that scalars will end up as array scalars, which is important
for using the result as the value of the out argument in some
operations.
Parameters
----------
a : array-like
Input array.
val : float
NaN values are set to val before doing the operation.
Returns
-------
y : ndarray
If `a` is of inexact type, return a copy of `a` with the NaNs
replaced by the fill value, otherwise return `a`.
mask: {bool, None}
If `a` is of inexact type, return a boolean mask marking locations of
NaNs, otherwise return None.
)r NT)Zsubokcopy)where)r
asanyarrayr object_ not_equalbool
issubclasstypeinexactr arraycopyto)r valmaskr r r _replace_nanD s
r, c C s0 t | tjr tj| ||dd n| jj|} | S )a\
Replace values in `a` with NaN where `mask` is True. This differs from
copyto in that it will deal with the case where `a` is a numpy scalar.
Parameters
----------
a : ndarray or numpy scalar
Array or numpy scalar some of whose values are to be replaced
by val.
val : numpy scalar
Value used a replacement.
mask : ndarray, scalar
Boolean array. Where True the corresponding element of `a` is
replaced by `val`. Broadcasts.
Returns
-------
res : ndarray, scalar
Array with elements replaced or scalar `val`.
unsafe)r casting)
isinstancer ndarrayr) r r&