File: //opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/__pycache__/nanfunctions.cpython-37.pyc
B
<�Fd�� �
@ s� d Z ddlmZmZmZ ddlZddlZddlm Z ddddd d
ddd
ddddg
Z
dd� Zdd� Zd1dd�Z
ddejfdd�Zddejfdd�Zd2dd �Zd3dd�Zdddejfdd�Zdddejfdd�Zd4dd�Zd5dd�Zdddejfd d
�Zd6d"d#�Zd7d$d%�Zd8d&d'�Zddd!ejfd(d�Zddd!d)ejfd*d�Zd9d+d,�Zd:d-d.�Zddddejfd/d
�Zddddejfd0d�Z dS );as
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
- `nanpercentile` -- qth percentile of non-NaN values
� )�division�absolute_import�print_functionN)�_ureduce�nansum�nanmax�nanmin� nanargmax� nanargmin�nanmean� nanmedian�
nanpercentile�nanvar�nanstd�nanprod� nancumsum�
nancumprodc C sf t j| ddd�} | jt jkr&| | k}n t| jjt j�rBt �| �}nd}|dk r^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.
T)Zsubok�copyN)�where) �npZarray�dtype�object_�
issubclass�type�inexact�isnan�copyto)�a�val�mask� r �I/opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/nanfunctions.py�_replace_nan$ s
r"