관리-도구
편집 파일: nanfunctions.cpython-311.pyc
� �܋f� � �X � d Z ddlZddlZddlZddlmZ ddlmZ ej ej d�� � Z g d�Zd4d�Zd � Z d � Zd5d�Zd4d �Z d6d�Z e e� � ddej ej ej fd�� � Z d6d�Z e e� � ddej ej ej fd�� � Zd7dd�d�Z e e� � d7ej d�d�� � Zd7dd�d�Z e e� � d7ej d�d�� � Z d8d�Z e e� � dddej ej ej fd�� � Z d8d�Z e e� � dddej ej ej fd�� � Zd9d�Z e e� � d9d�� � Zd9d�Z e e � � d9d�� � Z!d:dd�d �Z" e e"� � dddej fej d�d!�� � Z#d5d"�Z$d;d#�Z%d;d$�Z& d:d%�Z' e e'� � dddej fd&�� � Z( d6dd'�d(�Z) e e)� � dddd)ej fdd'�d*�� � Z* d6dd'�d+�Z+ e e+� � dddd)ej fdd'�d,�� � Z,dddd)ej fd-�Z- d<d.�Z.d=d/�Z/ d6dd�d0�Z0 e e0� � ddddej fej d�d1�� � Z1 d6dd�d2�Z2 e e2� � ddddej fej d�d3�� � Z3dS )>a� 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)� overrides�numpy)�module)�nansum�nanmax�nanmin� nanargmax� nanargmin�nanmean� nanmedian� nanpercentile�nanvar�nanstd�nanprod� nancumsum� nancumprod�nanquantilec �~ � | j j dvrdS t j | |�� � }t j ||�� � }|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``. �fcT��out)�dtype�kind�np�isnan�invert)�ar �ys �M/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/lib/nanfunctions.py� _nan_maskr! ) sE � �( �w�|�4����t� �������A� � �!�����A��H� c �l � t j | � � } | j t j k rt j | | t �� � }n;t | j j t j � � rt j | � � }nd}|�.t j | dd�� � } t j | ||�� � | |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)�subok�copy��where)r � asanyarrayr �object_� not_equal�bool� issubclass�type�inexactr �array�copyto�r �val�masks r �_replace_nanr5 D s� � �8 � �a���A��w�"�*����|�A�q��-�-�-��� �A�G�L�"�*� -� -� ��x��{�{��������H�Q�d��.�.�.�� � �!�S��%�%�%�%��d�7�Nr"