Ë
    *�£jÓ  ã                  óÔ  — d Z ddlmZ ddlmZ ddlZddlZddlm	Z	m
Z ddlmZ erddlmZ ddlmZmZ d	dde	j&                  d
œ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zd	dde	j&                  d
œ	 	 	 	 	 	 	 	 	 	 	 dd„Zd	dddœ	 	 	 	 	 	 	 	 	 dd„Zd	ddœ	 	 	 	 	 	 	 	 	 dd„Zd	ddœ	 	 	 	 	 	 	 dd„Zd	ddœ	 	 	 	 	 	 	 dd„Zd	ddœ	 	 	 	 	 	 	 dd„Zd	dddœ	 	 	 	 	 	 	 	 	 dd„Zd	dddœ	 	 	 	 	 	 	 	 	 dd„Zy)zb
masked_reductions.py is for reduction algorithms using a mask-based approach
for missing values.
é    )Úannotations)ÚTYPE_CHECKINGN)ÚlibÚmissing)Úcheck_below_min_count)ÚCallable)ÚAxisIntÚnptT)ÚskipnaÚ	min_countÚaxisÚinitialc               óB  — |t         j                  ur||d<   |sB|j                  «       st        |j                  d|«      rt
        j                  S  | |fd|i|¤ŽS t        |j                  ||«      r!|�|j                  dk(  rt
        j                  S  | |f| |dœ|¤ŽS )a  
    Sum, mean or product for 1D masked array.

    Parameters
    ----------
    func : np.sum or np.prod
    values : np.ndarray
        Numpy array with the values (can be of any dtype that support the
        operation).
    mask : np.ndarray[bool]
        Boolean numpy array (True values indicate missing values).
    skipna : bool, default True
        Whether to skip NA.
    min_count : int, default 0
        The required number of valid values to perform the operation. If fewer than
        ``min_count`` non-NA values are present the result will be NA.
    axis : int, optional, default None
    initial : scalar, optional
        Starting value for the reduction. NumPy has a default value for most
        data types, but for object-dtype arrays we need to specify it explicitly
    r   Nr   é   )Úwherer   )r   Ú
no_defaultÚanyr   ÚshapeÚ
libmissingÚNAÚndim)ÚfuncÚvaluesÚmaskr   r   r   r   Úkwargss           úKC:\FundamentalWorkbench\vendor\pandas\core\array_algos\masked_reductions.pyÚ_reductionsr      s™   € ð@ ”c—n‘nÑ$Ø#ˆˆyÑáØ�8‰8Œ:Ô.¨v¯|©|¸TÀ9ÔMÜ—=‘=Ð á˜Ñ4 TÐ4¨VÑ4Ð4ä  §¡¨t°YÔ?ØˆL˜FŸK™K¨1Ò,ä—=‘=Ð á�FÐ= 4 %¨dÑ=°fÑ=Ð=ó    c          	     óB   — t        t        j                  | |||||¬«      S )N©r   r   r   r   r   r   )r   ÚnpÚsumr    s         r   r"   r"   N   s*   € ô Ü
�‰ØØØØØØôð r   )r   r   r   c               ó@   — t        t        j                  | ||||¬«      S )N©r   r   r   r   r   )r   r!   Úprodr$   s        r   r%   r%   b   s#   € ô Ü
�‰˜ T°&ÀIÐTXôð r   )r   r   c               óÊ   — |s6|j                  «       s|j                  st        j                  S  | ||¬«      S ||    }|j                  r
 | ||¬«      S t        j                  S )a›  
    Reduction for 1D masked array.

    Parameters
    ----------
    func : np.min or np.max
    values : np.ndarray
        Numpy array with the values (can be of any dtype that support the
        operation).
    mask : np.ndarray[bool]
        Boolean numpy array (True values indicate missing values).
    skipna : bool, default True
        Whether to skip NA.
    axis : int, optional, default None
    )r   )r   Úsizer   r   )r   r   r   r   r   Úsubsets         r   Ú_minmaxr)   o   sX   € ñ. Ø�8‰8Œ:˜VŸ[š[ä—=‘=Ð á˜ TÔ*Ð*à˜˜‘ˆØ�;Š;Ù˜ TÔ*Ð*ô —=‘=Ð r   c               ó>   — t        t        j                  | |||¬«      S ©N©r   r   r   r   )r)   r!   Úminr,   s       r   r-   r-   •   ó   € ô ”2—6‘6 &¨t¸FÈÔNÐNr   c               ó>   — t        t        j                  | |||¬«      S r+   )r)   r!   Úmaxr,   s       r   r0   r0   Ÿ   r.   r   c               ó–   — | j                   r|j                  «       rt        j                  S t	        t
        j                  | |||¬«      S r+   )r'   Úallr   r   r   r!   Úmeanr,   s       r   r3   r3   ©   s4   € ð �;Š;˜$Ÿ(™(œ*Ü�}‰}ÐÜ”r—w‘w v°DÀÈdÔSÐSr   r   )r   r   Úddofc          	     ó   — | j                   r|j                  «       rt        j                  S t	        j
                  «       5  t	        j                  dt        «       t        t        j                  | ||||¬«      cd d d «       S # 1 sw Y   y xY w©NÚignore©r   r   r   r   r4   )r'   r2   r   r   ÚwarningsÚcatch_warningsÚsimplefilterÚRuntimeWarningr   r!   Úvarr8   s        r   r=   r=   µ   ó^   € ð �;Š;˜$Ÿ(™(œ*Ü�}‰}Ðä	×	 Ñ	 Õ	"Ü×Ñ˜h¬Ô7ÜÜ�F‰F˜6¨°VÀ$ÈTô
÷ 
#×	"Ò	"úó   Á9BÂBc          	     ó   — | j                   r|j                  «       rt        j                  S t	        j
                  «       5  t	        j                  dt        «       t        t        j                  | ||||¬«      cd d d «       S # 1 sw Y   y xY wr6   )r'   r2   r   r   r9   r:   r;   r<   r   r!   Ústdr8   s        r   rA   rA   Ç   r>   r?   )r   r   r   ú
np.ndarrayr   únpt.NDArray[np.bool_]r   Úboolr   Úintr   úAxisInt | Noner   úobject | lib.NoDefault)r   rB   r   rC   r   rD   r   rE   r   rF   r   rG   )
r   rB   r   rC   r   rD   r   rE   r   rF   )
r   r   r   rB   r   rC   r   rD   r   rF   )r   rB   r   rC   r   rD   r   rF   )
r   rB   r   rC   r   rD   r   rF   r4   rE   )Ú__doc__Ú
__future__r   Útypingr   r9   Únumpyr!   Úpandas._libsr   r   r   Úpandas.core.nanopsr   Úcollections.abcr   Úpandas._typingr	   r
   r   r   r"   r%   r)   r-   r0   r3   r=   rA   © r   r   Ú<module>rQ      sn  ðñõ
 #å  Û ã ÷õ
 5áÝ(÷ð ØØØ&)§n¡nñ.>Ø
ð.>àð.>ð  ð.>ð
 ð.>ð ð.>ð ð.>ð $ó.>ðj ØØØ&)§n¡nñØðà
ðð ð	ð
 ðð ðð $óð0 ØØñ
Øð
à
ð
ð ð	
ð
 ð
ð ó
ð$ Øñ#!Ø
ð#!àð#!ð  ð#!ð
 ð#!ð ó#!ðT ØñOØðOà
ðOð ð	Oð
 óOð ØñOØðOà
ðOð ð	Oð
 óOð Øñ	TØð	Tà
ð	Tð ð		Tð
 ó	Tð  ØØñ
Øð
à
ð
ð ð	
ð
 ð
ð ó
ð, ØØñ
Øð
à
ð
ð ð	
ð
 ð
ð ô
r   