Ë
    u™ãjÆ
 ã                  ó  — d dl mZ d dlZd dlZd dlmZmZmZmZ d dl	Z	d dl
Zd dlmZ d dlmZmZmZmZ d dlmc mZ d dlmZ d dlmZ d dlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ d d	l%m&Z&m'Z'm(Z( erd d
l)m*Z* d dl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4  edd¬«      Z5e5duZ6da7dYdZd„Z8 e8ed   d   «        G d„ d«      Z9 G d„ d«      Z:d[d„Z;d\d„Z<	 d]	 	 	 d^d„Z=	 	 	 	 	 	 	 	 d_d„Z>	 	 	 d`	 	 	 	 	 	 	 	 	 	 	 dad„Z?dbd„Z@dcd„ZAd]ddd„ZBded „ZCdfd!„ZDded"„ZEdgd#„ZFdhd$„ZGdid%„ZHdjd&„ZIded'„ZJdkd(„ZKdddd)œ	 	 	 	 	 	 	 	 	 dld*„ZLdddd)œ	 	 	 	 	 	 	 	 	 dld+„ZM e9d,«      eCeEddd dd-œ	 	 	 	 	 	 	 	 	 	 	 dmd.„«       «       «       ZN	 	 	 	 	 	 	 	 	 	 	 	 dnd/„ZO	 	 	 	 	 	 	 	 	 	 dod0„ZPeJ e:«       eCdddd)œ	 	 	 	 	 	 	 	 	 dpd1„«       «       «       ZQeJ e:«       dddd)œ	 	 	 	 	 	 	 dqd2„«       «       ZR	 	 	 	 	 	 drd3„ZS ej¨                  ejª                  «      f	 	 	 	 	 	 	 	 	 	 	 dsd4„ZVeJ e:d5¬6«      ddd5dd7œ	 	 	 	 	 dtd8„«       «       ZWeJ e9d,d9«       e:d5¬6«      ddd5dd7œ	 	 	 	 	 	 	 dud:„«       «       «       ZXeJ e9d,d9«      ddd5dd7œ	 	 	 	 	 	 	 	 	 	 	 dvd;„«       «       ZY	 	 	 	 	 	 	 	 	 	 dwd<„ZZdxd=„Z[	 	 	 	 	 	 	 	 	 	 dyd>„Z\dd?œ	 	 	 	 	 	 	 	 	 	 	 dzd@„Z]dA„ Z^ e^dBdC¬D«      Z_ e^dEdF¬D«      Z`dddd)œ	 	 	 	 	 	 	 	 	 d{dG„Zadddd)œ	 	 	 	 	 	 	 	 	 d{dH„ZbeJ e9d,d9«      eEdddd)œ	 	 	 	 	 	 	 	 	 d|dI„«       «       «       ZceJ e9d,d9«      eEdddd)œ	 	 	 	 	 	 	 	 	 d|dJ„«       «       «       Zd e9d,d9«      eEddd dd-œ	 	 	 	 	 	 	 	 	 	 	 d}dK„«       «       Ze	 	 	 	 	 	 	 	 d~dL„Zf	 	 	 	 	 	 	 	 	 	 ddM„Zg ej¨                  ejª                  «      f	 	 	 	 	 	 	 	 	 d€dN„Zh	 	 d�	 	 	 	 	 	 	 	 	 	 	 	 	 d‚dO„Zi	 	 	 	 	 	 	 	 dƒdP„Zj e9d,d9«      dQddRœ	 	 	 	 	 	 	 	 	 d„dS„«       Zk	 	 	 	 d…dT„Zld†dU„Zm e9d,d9«      dd5dVœ	 	 	 	 	 	 	 	 	 d‡dW„«       ZndˆdX„Zoy)‰é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚLiteralÚcast)Ú_global_config)ÚNaTÚNaTTypeÚiNaTÚlib)ÚOutOfBoundsTimedelta)Úimport_optional_dependency)Úensure_float64Úis_floatÚis_float_dtypeÚ
is_integerÚis_numeric_dtypeÚis_object_dtypeÚneeds_i8_conversionÚpandas_dtype)ÚisnaÚna_value_for_dtypeÚnotna)ÚCallable)	Ú	ArrayLikeÚAxisIntÚCorrelationMethodÚDtypeÚDtypeObjÚFÚScalarÚShapeÚnptÚ
bottleneckÚwarn)ÚerrorsFTc                ó   — t         r| ay y ©N)Ú_BOTTLENECK_INSTALLEDÚ_USE_BOTTLENECK)Úvs    ú]/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/core/nanops.pyÚset_use_bottleneckr-   ?   s   € õ Ø‰ð ó    ÚcomputeÚuse_bottleneckc                  ó0   ‡ — e Zd Zdˆ fd„Zdd„Zdd„Zˆ xZS )Údisallowc                óP   •— t         ‰| �  «        t        d„ |D «       «      | _        y )Nc              3  óF   K  — | ]  }t        |«      j                  –— Œ y ­wr(   )r   Útype)Ú.0Údtypes     r,   ú	<genexpr>z$disallow.__init__.<locals>.<genexpr>L   s   è ø€ ÒI¸œL¨Ó/×4Õ4ÑIùs   ‚!)ÚsuperÚ__init__ÚtupleÚdtypes)Úselfr<   Ú	__class__s     €r,   r:   zdisallow.__init__J   s    ø€ Ü‰ÑÔÜÑIÀ&ÔIÓIˆ�r.   c                ór   — t        |d«      xr* t        |j                  j                  | j                  «      S )Nr7   )ÚhasattrÚ
issubclassr7   r5   r<   )r=   Úobjs     r,   Úcheckzdisallow.checkN   s'   € Ü�s˜GÓ$ÒP¬°C·I±I·N±NÀDÇKÁKÓ)PÐPr.   c                óZ   ‡ ‡— t        j                  ‰«      ˆˆ fd„«       }t        d|«      S )Nc                 ó4  •— t        j                  | |j                  «       «      }t        ˆfd„|D «       «      r+‰j                  j                  dd«      }t        d|› d�«      ‚	  ‰| i |¤ŽS # t        $ r }t        | d   «      rt        |«      |‚‚ d }~ww xY w)Nc              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr(   )rC   )r6   rB   r=   s     €r,   r8   z0disallow.__call__.<locals>._f.<locals>.<genexpr>U   s   øè ø€ Ò7 s�4—:‘:˜c—?Ñ7ùs   ƒÚnanÚ zreduction operation 'z' not allowed for this dtyper   )	Ú	itertoolsÚchainÚvaluesÚanyÚ__name__ÚreplaceÚ	TypeErrorÚ
ValueErrorr   )ÚargsÚkwargsÚobj_iterÚf_nameÚeÚfr=   s        €€r,   Ú_fzdisallow.__call__.<locals>._fR   s™   ø€ ä —‘ t¨V¯]©]«_Ó=ˆHÜÓ7¨hÔ7Ô7ØŸ™×+Ñ+¨E°2Ó6�ÜØ+¨F¨8Ð3OÐPóð ð	Ù˜$Ð) &Ñ)Ð)øÜò ô
 # 4¨¡7Ô+Ü# A›,¨AÐ-Øûðús   Á&A. Á.	BÁ7BÂBr    ©Ú	functoolsÚwrapsr   )r=   rV   rW   s   `` r,   Ú__call__zdisallow.__call__Q   s,   ù€ Ü	�‰˜Ó	ô	ó 
ð	ô$ �C˜‹}Ðr.   )r<   r   ÚreturnÚNone©r\   Úbool)rV   r    r\   r    )rM   Ú
__module__Ú__qualname__r:   rC   r[   Ú__classcell__)r>   s   @r,   r2   r2   I   s   ø„ õJóQ÷r.   r2   c                  ó   — e Zd Zddd„Zdd„Zy)Úbottleneck_switchNc                ó    — || _         || _        y r(   )ÚnamerR   )r=   rf   rR   s      r,   r:   zbottleneck_switch.__init__i   s   € ØˆŒ	Øˆ�r.   c                óú   ‡ ‡‡‡— ‰ j                   xs ‰j                  Š	 t        t        ‰«      Št        j                  ‰«      d ddœ	 	 	 	 	 dˆˆˆˆ fd„«       }t        d|«      S # t        t
        f$ r d ŠY ŒIw xY w)NT©ÚaxisÚskipnac               ó®  •— t        ‰
j                  «      dkD  r,‰
j                  j                  «       D ]  \  }}||vsŒ|||<   Œ t        r}|r{| j                  dkD  rlt        | j                  ‰	«      rV|j                  dd «      €6|j                  dd «        ‰| fd|i|¤Ž}t        |«      r ‰| f||dœ|¤Ž}|S  ‰| f||dœ|¤Ž}|S  ‰| f||dœ|¤Ž}|S )Nr   Úmaskri   rh   )
ÚlenrR   Úitemsr*   ÚsizeÚ_bn_ok_dtyper7   ÚgetÚpopÚ	_has_infs)rK   ri   rj   ÚkwdsÚkr+   ÚresultÚaltÚbn_funcÚbn_namer=   s          €€€€r,   rV   z%bottleneck_switch.__call__.<locals>.fu   sÿ   ø€ ô �4—;‘;Ó !Ò#Ø ŸK™K×-Ñ-Ó/ò $‘D�A�qØ ’}Ø"#˜˜Qšð$õ  ÙØ—K‘K !’OÜ  §¡¨wÔ7à—8‘8˜F DÓ)Ð1ð —H‘H˜V TÔ*Ù$ VÑ?°$Ð?¸$Ñ?�Fô ! Ô(Ù!$ VÐ!N°$¸vÑ!NÈÑ!N˜ð ˆMñ	 ! ÐJ¨d¸6ÑJÀTÑJ�Fð ˆMñ ˜VÐF¨$°vÑFÀÑF�àˆMr.   r    )rK   ú
np.ndarrayri   úAxisInt | Nonerj   r_   )	rf   rM   ÚgetattrÚbnÚAttributeErrorÚ	NameErrorrY   rZ   r   )r=   rw   rV   rx   ry   s   `` @@r,   r[   zbottleneck_switch.__call__m   s’   û€ Ø—)‘)Ò+˜sŸ|™|ˆð	Üœb 'Ó*ˆGô 
�‰˜Ó	ð $(Øñ	#	Øð#	ð !ð#	ð ÷	#	ó 
ð#	ôJ �C˜‹|ÐøôS ¤	Ð*ò 	ØŠGð	ús    A& Á&A:Á9A:r(   )r\   r]   )rw   r    r\   r    )rM   r`   ra   r:   r[   © r.   r,   rd   rd   h   s   „ ôô.r.   rd   c                ó4   — | t         k7  rt        | «      s|dvS y)N)ÚnansumÚnanprodÚnanmeanF)Úobjectr   )r7   rf   s     r,   rp   rp   ž   s"   € à”‚Ô2°5Ô9ð Ð;Ð;Ð;Ør.   c                ó  — t        | t        j                  «      r2| j                  dv r$t	        j
                  | j                  d«      «      S 	 t        j                  | «      j                  «       S # t        t        f$ r Y yw xY w)N)Úf8Úf4ÚKF)Ú
isinstanceÚnpÚndarrayr7   r   Úhas_infsÚravelÚisinfrL   rO   ÚNotImplementedError)rv   s    r,   rs   rs   ²   sk   € Ü�&œ"Ÿ*™*Ô%Ø�<‰<˜<Ñ'ô —<‘< §¡¨SÓ 1Ó2Ð2ðÜ�x‰x˜Ó×#Ñ#Ó%Ð%øÜÔ*Ð+ò áðús   Á"A1 Á1BÂBc                óª  — |�|S t        | «      r8|€t        j                  S |dk(  rt        j                  S t        j                   S | j                  dk(  r=|dk(  r#t        j
                  t        j                  «      S t        j
                  d«      S |dk(  r#t        j                  t        j                  «      S t        j                  t        «      S )z9return the correct fill value for the dtype of the valuesú+infÚur   )Ú_na_ok_dtyper‹   rG   ÚinfÚkindÚuint64r   Úu8maxÚint64Úi8maxr   )r7   Ú
fill_valueÚfill_value_typs      r,   Ú_get_fill_valuer�   ¿   s¥   € ð ÐØÐÜ�EÔØÐ!Ü—6‘6ˆMØ˜vÒ%Ü—6‘6ˆMä—F‘F�7ˆNØ	�‰�sÒ	ð ˜VÒ#Ü—9‘9œSŸY™YÓ'Ð'Ü�y‰y˜‹|ÐØ	˜6Ò	!ô
 �x‰xœŸ	™	Ó"Ð"ä�x‰xœ‹~Ðr.   c                ó†   — |€>| j                   j                  dv ry|s| j                   j                  dv rt        | «      }|S )a/  
    Compute a mask if and only if necessary.

    An explicit `mask` is returned unchanged; the values it marks need not be
    NaN (a masked array stores fill values there).  Otherwise one is computed
    with isna(), but only where it is needed: never for boolean or integer
    values, which cannot store NaN, and under skipna=False only for
    datetime64/timedelta64, whose NaT stops being detectable once `_get_values`
    views it as i8 (GH#37392).

    A caller that already holds that i8 view must pass its own mask.

    Parameters
    ----------
    values : ndarray
        input array to potentially compute mask for
    skipna : bool
        boolean for whether NaNs should be skipped
    mask : Optional[ndarray]
        nan-mask if known

    Returns
    -------
    Optional[np.ndarray[bool]]
    NÚbiuÚmM)r7   r–   r   )rK   rj   rl   s      r,   Ú_maybe_get_maskr¡   ß   s@   € ð8 €|Ø�<‰<×Ñ Ñ%àá�V—\‘\×&Ñ&¨$Ñ.Ü˜“<ˆDà€Kr.   c                ó¤  — t        | ||«      }| j                  }d}| j                  j                  dv r&t        j                  | j                  d«      «      } d}|rr|�pt        |||¬«      }|�`|j                  «       rP|st        |«      r+| j                  «       } t        j                  | ||«       | |fS t        j                  | | |«      } | |fS )a   
    Utility to get the values view, mask, dtype, dtype_max, and fill_value.

    If both mask and fill_value/fill_value_typ are not None and skipna is True,
    the values array will be copied.

    For input arrays of boolean or integer dtypes, copies will only occur if a
    precomputed mask, a fill_value/fill_value_typ, and skipna=True are
    provided.

    Parameters
    ----------
    values : ndarray
        input array to potentially compute mask for
    skipna : bool
        boolean for whether NaNs should be skipped
    fill_value : Any
        value to fill NaNs with
    fill_value_typ : str
        Set to '+inf' or '-inf' to handle dtype-specific infinities
    mask : Optional[np.ndarray[bool]]
        nan-mask if known

    Returns
    -------
    values : ndarray
        Potential copy of input value array
    mask : Optional[ndarray[bool]]
        Mask for values, if deemed necessary to compute
    Fr    Úi8T)r›   rœ   )r¡   r7   r–   r‹   ÚasarrayÚviewr�   rL   r”   ÚcopyÚputmaskÚwhere)rK   rj   r›   rœ   rl   r7   Údatetimelikes          r,   Ú_get_valuesrª     sÎ   € ôR ˜6 6¨4Ó0€Dà�L‰L€Eà€LØ‡|�|×Ñ˜DÑ ô —‘˜FŸK™K¨Ó-Ó.ˆØˆá�4Ð#ô %Ø˜j¸ô
ˆ
ð Ð!Ø�x‰xŒzÙ¤<°Ô#6Ø#Ÿ[™[›]�FÜ—J‘J˜v t¨ZÔ8ð
 �4ˆ<Ðô  ŸX™X t e¨V°ZÓ@�Fà�4ˆ<Ðr.   c                ó<  — | }| j                   dv r%t        j                  t        j                  «      }|S | j                   dk(  r%t        j                  t        j                  «      }|S | j                   dk(  r#t        j                  t        j
                  «      }|S )NÚbir“   rV   )r–   r‹   r7   r™   r—   Úfloat64)r7   Ú	dtype_maxs     r,   Ú_get_dtype_maxr¯   M  s{   € à€IØ‡z�z�TÑÜ—H‘HœRŸX™XÓ&ˆ	ð
 Ðð	 
�‰�sÒ	Ü—H‘HœRŸY™YÓ'ˆ	ð Ðð 
�‰�sÒ	Ü—H‘HœRŸZ™ZÓ(ˆ	ØÐr.   c                ód   — t        | «      ryt        | j                  t        j                  «       S )NF)r   rA   r5   r‹   Úinteger©r7   s    r,   r”   r”   Y  s%   € Ü˜5Ô!ØÜ˜%Ÿ*™*¤b§j¡jÓ1Ð1Ð1r.   c                ód  — | t         u r	 | S |j                  dk(  rÆ|€t        }t        | t        j
                  «      s‘t        |«      rJ d«       ‚| |k(  rt        j                  } t        | «      r&t	        j                  dd«      j                  |«      } n$t	        j                  | «      j                  |«      } | j                  |d¬«      } | S | j                  |«      } | S |j                  dk(  �r?t        | t        j
                  «      s¥|s| |k(  st	        j                  | «      r0t	        j                  |«      d   }t	        j                  d|«      } | S t	        j                  | «      t         j"                  kD  rt%        d	«      ‚t	        j                  | «      j                  |d¬«      } | S t	        j&                  | «      t         j"                  kD  }|�|| z  }t	        j(                  |d| «      } |j+                  «       rt%        d	«      ‚| j                  d
«      j                  |«      } | S )zwrap our results if neededÚMzExpected non-null fill_valuer	   ÚnsF©r¦   Úmr   úoverflow in timedelta operationzm8[ns])r	   r–   r   rŠ   r‹   rŒ   r   rG   Ú
datetime64Úastyper™   r¥   ÚisnanÚdatetime_dataÚtimedelta64Úfabsr   rš   r   Úabsr¨   rL   )rv   r7   r›   Úresult_maskÚunitÚoverflows         r,   Ú_wrap_resultsrÃ   _  sã  € à”�}ØðZ €MðW 
�‰�sÒ	ØÐäˆJÜ˜&¤"§*¡*Ô-Ü˜JÔ'ÐGÐ)GÓGÐ'Ø˜Ò#ÜŸ™�ä�FŒ|ÜŸ™ u¨dÓ3×:Ñ:¸5ÓA‘äŸ™ &Ó)×.Ñ.¨uÓ5�à—]‘] 5¨u�]Ó5ˆFð: €Mð5 —]‘] 5Ó)ˆFð4 €Mð3 
�‰�sÓ	Ü˜&¤"§*¡*Ô-Ù˜f¨
Ò2´b·h±h¸vÔ6FÜ×'Ñ'¨Ó.¨qÑ1�ÜŸ™¨¨tÓ4�ð* €Mô' —‘˜“¤3§9¡9Ò,ä*Ð+LÓMÐMô Ÿ™ &Ó)×0Ñ0°¸UÐ0ÓC�ð €Mô —v‘v˜f“~¬¯	©	Ñ1ˆHØÐ&ð ˜[˜LÑ(�ÜŸ™ +¨q°&Ó9�Ø�|‰|Œ~ä*Ð+LÓMÐMØ—]‘] 8Ó,×1Ñ1°%Ó8ˆFà€Mr.   c                óp   ‡ — t        j                  ‰ «      ddddœ	 	 	 	 	 	 	 dˆ fd„«       }t        d|«      S )z˜
    If we have datetime64 or timedelta64 values, ensure we have a correct
    mask before calling the wrapped function, then cast back afterwards.
    NT©ri   rj   rl   c               óœ  •— | }| j                   j                  dv }|r|€t        | «      } ‰	| f|||dœ|¤Ž}|r’t        |dd «      |j                   k(  r|S d }|sA|€J ‚t	        |t
        j                  «      r|j                  |¬«      }n|j                  «       }t        ||j                   t        |¬«      }|s|€J ‚t        ||||«      }|S )Nr    rÅ   r7   ©ri   )r›   rÀ   )r7   r–   r   r|   rŠ   r‹   rŒ   rL   rÃ   r   Ú_mask_datetimelike_result)
rK   ri   rj   rl   rR   Úorig_valuesr©   rv   rÀ   Úfuncs
            €r,   Únew_funcz&_datetimelike_compat.<locals>.new_func˜  så   ø€ ð ˆà—|‘|×(Ñ(¨DÐ0ˆÙ˜D˜LÜ˜“<ˆDá�fÐL 4°¸TÑLÀVÑLˆáÜ�v˜w¨Ó-°×1BÑ1BÒBð �àˆKÙØÐ'Ð'Ð'ô ˜f¤b§j¡jÔ1Ø"&§(¡(° (Ó"5‘Kà"&§(¡(£*�KÜ"Ø˜×)Ñ)´dÈôˆFñ ØÐ'Ð'Ð'Ü2°6¸4ÀÀ{ÓS�àˆr.   r    ©rK   rz   ri   r{   rj   r_   rl   únpt.NDArray[np.bool_] | NonerX   ©rÊ   rË   s   ` r,   Ú_datetimelike_compatrÏ   ’  sa   ø€ ô ‡_�_�TÓð  $ØØ-1ñ'Øð'ð ð'ð ð	'ð
 +ô'ó ð'ôR ��XÓÐr.   c                ó0  — | j                   j                  dv r| j                  d«      } t        | j                   «      }| j                  dk(  r|S |€|S | j
                  d| | j
                  |dz   d z   }t        j                  ||| j                   ¬«      S )a�  
    Return the missing value for `values`.

    Parameters
    ----------
    values : ndarray
    axis : int or None
        axis for the reduction, required if values.ndim > 1.

    Returns
    -------
    result : scalar or ndarray
        For 1-D values, returns a scalar of the correct missing type.
        For 2-D values, returns a 1-D array where each element is missing.
    Úiufcbr­   é   Nr²   )r7   r–   rº   r   ÚndimÚshaper‹   Úfull)rK   ri   r›   Úresult_shapes       r,   Ú_na_for_min_countr×   Å  sŠ   € ð" ‡|�|×Ñ˜GÑ#Ø—‘˜yÓ)ˆÜ# F§L¡LÓ1€Jà‡{�{�aÒØÐØ	ˆØÐà—|‘| E TÐ*¨V¯\©\¸$À¹(¸*Ð-EÑEˆä�w‰w�| Z°v·|±|ÔDÐDr.   c                ó^   ‡ — t        j                  ‰ «      ddœdˆ fd„«       }t        d|«      S )z�
    NumPy operations on C-contiguous ndarrays with axis=1 can be
    very slow if axis 1 >> axis 0.
    Operate row-by-row and concatenate the results.
    NrÇ   c          	     óú  •— |dk(  rá| j                   dk(  rÒ| j                  d   rÃ| j                  d   dz  | j                  d   kD  r¡| j                  t        t
        fvr‰t        | «      }|j                  d«      �B|j                  d«      }t        t        |«      «      D �cg c]  } ‰||   fd||   i|¤Ž‘Œ }}n|D �cg c]  } ‰|fi |¤Ž‘Œ }}t        j                  |«      S  ‰| fd|i|¤ŽS c c}w c c}w )NrÒ   é   ÚC_CONTIGUOUSiè  r   rl   ri   )rÓ   ÚflagsrÔ   r7   r…   r_   Úlistrq   rr   Úrangerm   r‹   Úarray)	rK   ri   rR   Úarrsrl   ÚiÚresultsÚxrÊ   s	           €r,   Únewfuncz&maybe_operate_rowwise.<locals>.newfuncë  s   ø€ ð �AŠIØ—‘˜qÒ Ø—‘˜^Ò,ð —‘˜a‘ 4Ñ'¨6¯<©<¸©?Ò:Ø—‘¤V¬T NÑ2ä˜“<ˆDØ�z‰z˜&Ó!Ð-Ø—z‘z &Ó)�äCHÌÈTËÓCSöØ>?‘D˜˜a™Ñ9 t¨A¡wÐ9°&Ó9ð�ñ ð 7;Ö;°™4 Ñ, VÓ,Ð;�Ð;Ü—8‘8˜GÓ$Ð$á�FÑ0 Ð0¨Ñ0Ð0ùòùò <s   Â"C3ÃC8r    )rK   rz   ri   r{   rX   )rÊ   rä   s   ` r,   Úmaybe_operate_rowwiserå   ä  s2   ø€ ô ‡_�_�TÓØ>Bö 1ó ð1ô, ��WÓÐr.   c           
     ó"  — | j                   j                  dv rt        d| j                   › d�«      ‚| j                   t        k7  r| S t	        j
                  | «      \  }}|�t        d|›d�«      ‚|r‡t        j                  | j                  «       D �cg c],  }t        |t        j                  t        j                  f«      ‘Œ. c}«      }| j                  «       } d| |j                  | j                  «      <   	 t        j                   «       5  t        j"                  dt        j$                  j&                  «       | j)                  t        j*                  «      cddd«       S c c}w # 1 sw Y   nxY wn.# t        t,        t        j$                  j&                  f$ r Y nw xY wt/        | «      }| }|j1                  «       rÊ| j                  «       }t        j2                  ||<   	 t        j                   «       5  t        j"                  dt        j$                  j&                  «       |j)                  t        j*                  «      cddd«       S # 1 sw Y   nxY wn.# t        t,        t        j$                  j&                  f$ r Y nw xY w|j1                  «       r%| |   D �cg c]  }t5        |«      ‘Œ nc c}w c}||<   	 |j)                  t        j6                  «      S # t        t,        f$ r}t        dt9        |«      ›d�«      |‚d}~ww xY w)a	  
    Convert an object-dtype ndarray to the numeric dtype it represents.

    Object-dtype input is normalized once, up front, so that every statistic
    below can treat it exactly as it treats the equivalent float64/complex128
    array.  Whatever a reduction does for ``np.float64`` input it now also does
    for an object array of floats, and any object array that does not hold
    numbers raises ``TypeError`` from here instead of from whichever ufunc
    happened to touch it first.

    Parameters
    ----------
    values : np.ndarray

    Returns
    -------
    np.ndarray
        `values` unchanged if it is not object-dtype, else the equivalent
        float64 or complex128 array.

    Raises
    ------
    TypeError
        If the values are not numbers.
    ÚSUTzCould not convert z values to numericNz to numericÚerror)r7   r–   rO   r…   r   Úfirst_non_numericr‹   rß   rŽ   rŠ   r¹   r½   r¦   ÚreshaperÔ   ÚwarningsÚcatch_warningsÚsimplefilterÚ
exceptionsÚComplexWarningrº   r­   rP   r   rL   rG   Ú_to_complexÚ
complex128Ú_first_unconvertible)rK   Únon_numericÚhas_natÚvalÚnat_maskrl   ÚfilledÚerrs           r,   Ú_ensure_numericrù     sƒ  € ð4 ‡|�|×Ñ˜EÑ!ÜÐ,¨V¯\©\¨NÐ:LÐMÓNÐNØ‡|�|”vÒØˆô ×0Ñ0°Ó8Ñ€K�ØÐÜÐ,¨[¨O¸;ÐGÓHÐHáô
 —8‘8ØIOÏÉËÖXÀ#ŒZ˜œbŸm™m¬R¯^©^Ð<Õ=ÒXó
ˆð —‘“ˆØ15ˆˆx×Ñ §¡Ó-Ñ.ð	Ü×$Ñ$Ó&ñ 	-ô
 ×!Ñ! '¬2¯=©=×+GÑ+GÔHØ—=‘=¤§¡Ó,÷	-ñ 	-ùò Y÷	-ð 	-úð 	-øô ”z¤2§=¡=×#?Ñ#?Ð@ò Ùðúô �‹<€DØ€FØ‡x�x„zà—‘“ˆÜ—v‘vˆˆt‰ð	Ü×(Ñ(Ó*ñ 1Ü×%Ñ% g¬r¯}©}×/KÑ/KÔLØ—}‘}¤R§Z¡ZÓ0÷1÷ 1ò 1úð 1øô œ:¤r§}¡}×'CÑ'CÐDò 	Ùð	úð ‡x�x„zð 5;¸4±LÖA¨Sœ CÕ(ÑAùÔAˆˆt‰ðØ�}‰}œRŸ]™]Ó+Ð+øÜ”zÐ"ò äØ Ô!5°fÓ!=Ð @ÀÐLó
àð	ûðúsz   Â1E%Ã:E7 ÄAE*Å	E7 Å*E3Å/E7 Å7(F"Æ!F"Ç&I Ç:AIÉ	I ÉIÉI É(J	ÊJ	Ê#J6ËK! Ë!LË0L	Ì	Lc                ó”   — 	 t        | «      S # t        t        f$ r+ t        t        j                  t        j                  «      cY S w xY w)zV
    Convert `val` to a complex, mapping an NA that has no complex() to nan+nanj.
    )ÚcomplexrO   rP   r‹   rG   ©rõ   s    r,   rð   rð   \  s:   € ð'Ü�s‹|ÐøÜ”zÐ"ò 'Ü”r—v‘vœrŸv™vÓ&Ò&ð'ús   ‚
 �7AÁAc                óF   — 	 t        | «       y# t        t        f$ r Y yw xY w)zN
    Whether numpy's object->complex128 cast can handle `val` on its own.
    FT)rû   rO   rP   rü   s    r,   Ú_complex_castablerþ   f  s,   € ðÜ�Œð øô ”zÐ"ò Ùðús   ‚ Ž Ÿ c                óN   — | j                  «       D ]  }t        |«      rŒ|c S  | S )zS
    Return the element responsible for a failed `_ensure_numeric` conversion.
    )rŽ   rþ   )rK   rõ   s     r,   rò   rò   q  s-   € ð �|‰|‹~ò ˆÜ  Õ%ØŠJðð €Mr.   c                óX   ‡ — t        j                  ‰ «      dˆ fd„«       }t        d|«      S )zO
    Normalize object-dtype values before the wrapped reduction sees them.
    c                ó(   •—  ‰t        | «      fi |¤ŽS r(   )rù   )rK   rR   rÊ   s     €r,   rË   z'_ensure_numeric_input.<locals>.new_func�  s   ø€ á”O FÓ+Ñ6¨vÑ6Ð6r.   r    )rK   rz   rX   rÎ   s   ` r,   Ú_ensure_numeric_inputr  |  s/   ø€ ô
 ‡_�_�TÓô7ó ð7ô ��XÓÐr.   c                ó   — d| › d| › d�S )z™
    Message for the GH#34479 removal of any/all on datetime64 data.

    Shared so that the reduction, groupby and sparse paths cannot drift apart.
    ú'zH' with datetime64 dtypes is not supported. Use (obj != pd.Timestamp(0)).z() instead.r€   )Úhows    r,   Údt64_any_all_msgr  ˆ  s!   € ð ˆCˆ5ð (Ø(+ u¨Kð	9ðr.   rÅ   c               óH  — | j                   j                  dv r|€| j                  |«      S | j                   j                  dk(  rt        t	        d«      «      ‚t        | |d|¬«      \  } }| j                   t        k(  r| j                  t        «      } | j                  |«      S )a  
    Check if any elements along an axis evaluate to True.

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : bool

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 2])
    >>> nanops.nanany(s.values)
    np.True_

    >>> from pandas.core import nanops
    >>> s = pd.Series([np.nan])
    >>> nanops.nanany(s.values)
    np.False_
    Úiubr´   rL   F©r›   rl   )	r7   r–   rL   rO   r  rª   r…   rº   r_   ©rK   ri   rj   rl   Ú_s        r,   Únananyr  ”  s�   € ðD ‡|�|×Ñ˜EÑ! d lð �z‰z˜$ÓÐà‡|�|×Ñ˜CÒäÔ(¨Ó/Ó0Ð0ä˜F F°uÀ4ÔH�I€FˆAð ‡|�|”vÒØ—‘œtÓ$ˆð �:‰:�dÓÐr.   c               óH  — | j                   j                  dv r|€| j                  |«      S | j                   j                  dk(  rt        t	        d«      «      ‚t        | |d|¬«      \  } }| j                   t        k(  r| j                  t        «      } | j                  |«      S )a  
    Check if all elements along an axis evaluate to True.

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : bool

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 2, np.nan])
    >>> nanops.nanall(s.values)
    np.True_

    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 0])
    >>> nanops.nanall(s.values)
    np.False_
    r  r´   ÚallTr	  )	r7   r–   r  rO   r  rª   r…   rº   r_   r
  s        r,   Únanallr  Ì  s�   € ðD ‡|�|×Ñ˜EÑ! d lð �z‰z˜$ÓÐà‡|�|×Ñ˜CÒäÔ(¨Ó/Ó0Ð0ä˜F F°tÀ$ÔG�I€FˆAð ‡|�|”vÒØ—‘œtÓ$ˆð �:‰:�dÓÐr.   ÚM8)ri   rj   Ú	min_countrl   c               ó  — | j                   }|t        k(  rV|sT|€t        | «      }|j                  «       rI	 | j	                  |t        |«      ¬«      }t        |||| j                  |¬«      S t        | |d|¬«      \  } }t        |«      }|j                  dk(  r9|t        j                   k(  r#t        j                   t        j"                  «      n|}n9|j                  dk(  r*t%        | ||||«      }t        |||| j                  |d¬	«      S | j	                  ||¬«      }t        |||| j                  |¬«      }|S # t        $ r Y nw xY w| j                  dk(  s|€t        | |«      S t        | ||d«      } t        | ||«      }�Œ)
aÍ  
    Sum the elements along an axis ignoring NaNs

    Parameters
    ----------
    values : ndarray[dtype]
    axis : int, optional
    skipna : bool, default True
    min_count: int, default 0
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : dtype

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 2, np.nan])
    >>> nanops.nansum(s.values)
    np.float64(3.0)
    r²   ©r  rÒ   r   r	  rV   r·   T©r  r©   )r7   r…   r   rL   Úsumr¯   Ú_maybe_null_outrÔ   rO   rÓ   r×   Ú_blank_object_na_slicesÚ_na_min_countrª   r–   r‹   Úfloat16r­   Ú_sum_timedelta_i8)rK   ri   rj   r  rl   r7   Úthe_sumÚ	dtype_sums           r,   r‚   r‚     st  € ðD �L‰L€EØ”‚™vØˆ<Ü˜“<ˆDØ�8‰8Œ:ð
Ø Ÿ*™* T´ÀÓ1F˜*ÓG�ô 'Ø˜T 4¨¯©Àôð ô # 6¨6¸aÀdÔK‰ˆ�Ü˜uÓ%€IØ‡z�z�SÒà,1´R·Z±ZÒ,?”B—H‘HœRŸZ™ZÔ(ÀU‰	Ø	�‰�sÒ	ô $ F¨D°$¸À	ÓJˆÜØ�T˜4 §¡¸ÐQUô
ð 	
ð �j‰j˜ YˆjÓ/€GÜ˜g t¨T°6·<±<È9ÔU€Gà€Nøô; ò Ùðúð �{‰{˜aÒ 4 <ô )¨°Ó6Ð6Ü,¨V°T¸4ÀÓCˆFÜ% f¨d°IÓ>ŠIs   ¶D9 Ä9	EÅEc           	     ó  — t         j                  }|s|�|j                  |¬«      }|dkD  rY|�=| j                  dkD  r.| j                  |   |€dn|j                  |«      z
  }|||k  z  }n|t        | j                  ||«      z  }|s)|�'|j                  «       rt        j                  |d| «      } | j                  dk(  r!| j                  |t         j                  ¬«      S d}|€| j                  «       } n|}| j                  |   }t        t        t        | j                  «       «      «      t        t        | j                  «       «      «      «      }	|	rt        j                   |	z  n|}
|
|k\  r!| j                  |t         j                  ¬«      S t        j"                  d||
«      }t         j$                  j'                  | ||¬«      }|j                  |t(        ¬«      }|t*        k  |t        j                   kD  z  }t        j                  || z  «      rt-        d«      ‚t/        |t         j0                  «      r4t        j                  |d|«      j3                  t         j                  «      S t        j                  |rd«      S |«      S )a  
    Sum i8-viewed timedelta64 values exactly, raising on a result that does not
    fit in int64.

    int64 addition is modular, so an intermediate that leaves the range does not
    corrupt the total; only the total itself has to be checked.  Values are
    summed in blocks short enough that each block sum provably stays in range,
    and the block sums are then combined in Python ints.

    Parameters
    ----------
    values : ndarray[int64]
    axis : int, optional
    mask : ndarray[bool], optional
    skipna : bool
    min_count : int

    Returns
    -------
    int64 scalar or ndarray[int64]

    Raises
    ------
    OutOfBoundsTimedelta
        If the exact sum is not representable as a timedelta64, i.e. it lands
        outside (iNaT, i8max].
    rÇ   r   rÒ   r²   r¸   )r‹   ÚFalse_rL   rÓ   rÔ   r  Úcheck_below_min_countr¨   ro   r™   rŽ   Úmaxr¿   ÚintÚminr   rš   ÚarangeÚaddÚreduceatr…   r   r   rŠ   rŒ   rº   )rK   ri   rl   rj   r  ÚexemptÚcountsÚreduce_axisÚlengthÚlargestÚblockÚstartsÚ
block_sumsÚtotalÚout_of_ranges                  r,   r  r  Q  s  € ôJ %'§I¡I€FÙ�dÐ&Ø—‘˜t�Ó$ˆØ�1‚}ØÐ §¡¨a¢Ø—\‘\ $Ñ'°°©1À$Ç(Á(È4Ã.ÑQˆFØ˜v¨	Ñ1Ñ2‰FàÔ3°F·L±LÀ$È	ÓRÑRˆFá�dÐ&¨4¯8©8¬:ô —‘˜$  6Ó*ˆà‡{�{�aÒØ�z‰z˜$¤b§h¡hˆzÓ/Ð/à€KØ€|Ø—‘“‰àˆà�\‰\˜+Ñ&€FÜ”#”c˜&Ÿ*™*›,Ó'Ó(¬#¬c°&·*±*³,Ó.?Ó*@ÓA€GÙ$+ŒC�I‰I˜Ò °€Eà�‚ð �z‰z˜+¬R¯X©XˆzÓ6Ð6ä�Y‰Y�q˜& %Ó(€FÜ—‘—‘ ¨°k�ÓB€JØ�N‰N˜;¬fˆNÓ5€EàœT‘M e¬c¯i©iÑ&7Ñ8€LÜ	‡v�vˆl˜f˜WÑ$Ô%Ü"Ð#DÓEÐEä�%œŸ™Ô$ä�x‰x˜ a¨Ó/×6Ñ6´r·x±xÓ@Ð@Ü�8‰8™�AÓ1Ð1¨5Ó1Ð1r.   c                óL  — t        | t        j                  «      rG| j                  d«      j	                  |j
                  «      } |j                  |¬«      }t        | |<   | S |j                  «       r2t        j                  t        «      j	                  |j
                  «      S | S )Nr£   rÇ   )	rŠ   r‹   rŒ   rº   r¥   r7   rL   r   r™   )rv   ri   rl   rÉ   Ú	axis_masks        r,   rÈ   rÈ   ¥  s�   € ô �&œ"Ÿ*™*Ô%à—‘˜tÓ$×)Ñ)¨+×*;Ñ*;Ó<ˆØ—H‘H $�HÓ'ˆ	Ü ˆˆyÑð €Mð 
�‰ŒÜ�x‰xœ‹~×"Ñ" ;×#4Ñ#4Ó5Ð5Ø€Mr.   c               ó¸  — | j                   dk(  rt        dt        | |«      «      S | j                  }t	        | |d|¬«      \  } }t        |«      }t        j                  t        j                  «      }|j                  dv r$t        j                  t        j                  «      }n{|j                  dv r$t        j                  t        j                  «      }nI|j                  dk(  r:|t        j                  k(  r#t        j                  t        j                  «      n|}|}t        | j                  |||¬«      }| j                  ||¬«      }|�gt        |d	d
«      rZt        d|«      }t        j                  d¬«      5  ||z  }	ddd«       |dk(  }
|
j                  «       rt        j                   	|
<   	S |dkD  r||z  nt        j                   }	|	S # 1 sw Y   ŒOxY w)a  
    Compute the mean of the element along an axis ignoring NaNs

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    float
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 2, np.nan])
    >>> nanops.nanmean(s.values)
    np.float64(1.5)
    r   Úfloatr	  r    ÚiurV   r²   NrÓ   Frz   Úignore)r  )ro   r   r×   r7   rª   r¯   r‹   r­   r–   r  Ú_get_countsrÔ   r  r|   ÚerrstaterL   rG   )rK   ri   rj   rl   r7   r  Údtype_countÚcountr  Úthe_meanÚct_masks              r,   r„   r„   µ  s  € ðD ‡{�{�aÒä�GÔ.¨v°tÓ<Ó=Ð=à�L‰L€EÜ˜v v¸!À$ÔG�L€FˆDÜ˜uÓ%€IÜ—(‘(œ2Ÿ:™:Ó&€Kð ‡z�z�TÑÜ—H‘HœRŸZ™ZÓ(‰	Ø	�‰�tÑ	Ü—H‘HœRŸZ™ZÓ(‰	Ø	�‰�sÒ	à,1´R·Z±ZÒ,?”B—H‘HœRŸZ™ZÔ(ÀUˆ	Øˆä˜Ÿ™ d¨D¸ÔD€EØ�j‰j˜ YˆjÓ/€GàÐœG G¨V°UÔ;Ü�\ 5Ó)ˆÜ�[‰[˜XÔ&ñ 	'à ‘ˆH÷	'ð ˜1‘*ˆØ�;‰;Œ=Ü "§¡ˆH�WÑð €Oð ',¨a¢i�7˜U’?´R·V±Vˆà€O÷	'ð 	'ús   Å<GÇGc               óÖ  ‡— | j                   j                  dk(  xr |du }ddˆfd„}| j                   }t        | ‰|d¬«      \  } }| j                   j                  dvr| j                  d«      } |s;|�9| j                  j
                  s| j                  «       } t        j                  | |<   | j                  }| j                  dkD  rñ|�ï|rÖ‰st        j                  ||| «      }nît        j                  «       5  t        j                  dd	t        «       | j                   d   dk(  r|d
k(  s| j                   d
   dk(  rC|dk(  r>t        j"                  t        j$                  t        j&                  | «      «      d¬«      }nt        j"                  | |¬«      }ddd«       n2t)        | j                   |«      }n|r	 || |«      nt        j                  }t+        |«      S # 1 sw Y   ŒxY w)aI  
    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : float | ndarray
        Unless input is a float or complex array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 2, 2])
    >>> nanops.nanmedian(s.values)
    2.0

    >>> s = pd.Series([np.nan, np.nan, np.nan])
    >>> nanops.nanmedian(s.values)
    nan
    rV   Nc                ó�  •— |€t        | «      }n| }‰s9|j                  «       s)| j                  j                  t        j
                  «      S t        j                  «       5  t        j                  ddt        «       t        j                  ddt        «       t	        j                  | |   «      }d d d «       |S # 1 sw Y   S xY w)Nr5  úAll-NaN slice encounteredzMean of empty slice)r   r  r7   r5   r‹   rG   rë   rì   ÚfilterwarningsÚRuntimeWarningÚ	nanmedian)rã   Ú_maskÚresrj   s      €r,   Ú
get_medianznanmedian.<locals>.get_median  s£   ø€ Øˆ=Ü˜!“H‰Eà�FˆEÙ˜eŸi™iœkð —7‘7—<‘<¤§¡Ó'Ð'Ü×$Ñ$Ó&ñ 	)ä×#Ñ#ØÐ5´~ôô ×#Ñ# HÐ.CÄ^ÔTÜ—,‘,˜q ™xÓ(ˆC÷	)ð ˆ
÷	)ð ˆ
ús   Á"AB;Â;C)rl   r›   Úfcr‡   rÒ   r5  r>  r   T)ÚkeepdimsrÇ   r(   )rã   rz   )r7   r–   rª   rº   rÜ   Ú	writeabler¦   r‹   rG   ro   rÓ   Úapply_along_axisrë   rì   r?  r@  rÔ   rA  Ú
atleast_1dÚsqueezeÚ_get_empty_reduction_resultrÃ   )	rK   ri   rj   rl   Úusing_nan_sentinelrD  r7   ÚnotemptyrC  s	     `      r,   rA  rA  û  s¦  ø€ ðD  Ÿ™×*Ñ*¨cÑ1ÒB°d¸d°lÐöð& �L‰L€EÜ˜v v°DÀTÔJ�L€FˆDØ‡|�|×Ñ Ñ$ð —‘˜tÓ$ˆÙ $Ð"2Ø�|‰|×%Ò%Ø—[‘[“]ˆFÜ—v‘vˆˆt‰à�{‰{€Hð
 ‡{�{�Q‚˜4Ð+áÙÜ×)Ñ)¨*°d¸FÓC‘ô ×,Ñ,Ó.ñ >ä×+Ñ+Ø Ð"=¼~ôð Ÿ™ Q™¨1Ò,°¸²ØŸ™ Q™¨1Ò,°¸²ô !Ÿl™lÜŸM™M¬"¯*©*°VÓ*<Ó=Èô™ô !Ÿl™l¨6¸Ô=˜÷>ð >ô* .¨f¯l©l¸DÓA‰Cñ +3‰j˜ Ô&¼¿¹ˆÜ˜˜eÓ$Ð$÷5>ð >ús   Ã9BGÇG(c                ó   — t        j                  | «      }t        j                  t        | «      «      }t        j                  |||k7     t         j
                  ¬«      }|j                  t         j                  «       |S )z¬
    The result from a reduction on an empty ndarray.

    Parameters
    ----------
    shape : Tuple[int, ...]
    axis : int

    Returns
    -------
    np.ndarray
    r²   )r‹   rß   r#  rm   Úemptyr­   ÚfillrG   )rÔ   ri   ÚshpÚdimsÚrets        r,   rK  rK  g  sU   € ô  �(‰(�5‹/€CÜ�9‰9”S˜“ZÓ €DÜ
�(‰(�3�t˜t‘|Ñ$¬B¯J©JÔ
7€CØ‡H�HŒR�V‰VÔØ€Jr.   c                ó�  — t        | |||¬«      }||j                  |«      z
  }t        |«      r*||k  r!|j                  t        j                  «      x}}||fS t        d|«      }||k  }|j                  «       rJt        j                  ||t        j                  «       t        j                  ||t        j                  «       ||fS )a:  
    Get the count of non-null values along an axis, accounting
    for degrees of freedom.

    Parameters
    ----------
    values_shape : Tuple[int, ...]
        shape tuple from values ndarray, used if mask is None
    mask : Optional[ndarray[bool]]
        locations in values that should be considered missing
    axis : Optional[int]
        axis to count along
    ddof : int
        degrees of freedom
    dtype : type, optional
        type to use for count

    Returns
    -------
    count : np.floating or np.ndarray
    d : np.floating or np.ndarray
    r²   rz   )r6  r5   r   r‹   rG   r   rL   r§   )Úvalues_shaperl   ri   Úddofr7   r9  Úds          r,   Ú_get_counts_nanvarrX  ~  s¬   € ô: ˜ d¨D¸Ô>€EØ�—
‘
˜4Ó Ñ €Aô �„Ø�DŠ=ð Ÿ
™
¤2§6¡6Ó*Ð*ˆE�Að �!ˆ8€Oô �\ 5Ó)ˆØ˜‰}ˆØ�8‰8Œ:Ü�J‰J�q˜$¤§¡Ô'Ü�J‰J�u˜d¤B§F¡FÔ+Ø�!ˆ8€Or.   rÒ   ©rV  ©ri   rj   rV  rl   c          	     ó„  — | j                   j                  dk(  r7t        j                  | j                   «      d   }| j	                  d|› d�«      } | j
                  dk(  rt        dt        | |«      «      S | j                   }t        | ||¬«      \  } }t        j                  t        | ||||¬«      «      }t        ||«      S )aº  
    Compute the standard deviation along given axis while ignoring NaNs

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    ddof : int, default 1
        Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
        where N represents the number of elements.
    mask : ndarray[bool], optional
        NA-mask if known

    Returns
    -------
    result : float
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 2, 3])
    >>> nanops.nanstd(s.values)
    1.0
    r´   r   zm8[ú]r3  )rl   rZ  )r7   r–   r‹   r¼   r¥   ro   r   r×   rª   ÚsqrtÚnanvarrÃ   )rK   ri   rj   rV  rl   rÁ   Ú
orig_dtyperv   s           r,   Únanstdr`  ®  sª   € ðJ ‡|�|×Ñ˜CÒÜ×Ñ §¡Ó-¨aÑ0ˆØ—‘˜s 4 &¨˜]Ó+ˆà‡{�{�aÒä�GÔ.¨v°tÓ<Ó=Ð=à—‘€JÜ˜v v°DÔ9�L€FˆDä�W‰W”V˜F¨°fÀ4ÈdÔSÓT€FÜ˜ Ó,Ð,r.   Úm8c               óÐ  — | j                   dk(  rt        dt        | |«      «      S | j                  }t	        | ||«      }|j
                  dv r| j                  d«      } nD|j
                  dk(  r5t        | j                  ||||¬«      t        | j                  ||||¬«      z   S | j                  j
                  dk(  r't        | j                  |||| j                  «      \  }}nt        | j                  |||«      \  }}|�9| j                  «       } t        j                  | ||rdnt        j                  «       | j!                  |t        j"                  ¬«      |z  }|�t        j$                  ||«      }|| z
  d	z  }	|�t        j                  |	|d«       t        d
|	j!                  |t        j"                  ¬«      |z  «      }
|j
                  dk(  r|
j                  |d¬«      }
|
S )a°  
    Compute the variance along given axis while ignoring NaNs

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    ddof : int, default 1
        Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
        where N represents the number of elements.
    mask : ndarray[bool], optional
        NA-mask if known

    Returns
    -------
    result : float
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 2, 3])
    >>> nanops.nanvar(s.values)
    1.0
    r   r3  rŸ   r‡   ÚcrZ  rV   )ri   r7   rÚ   znp.ndarray | np.float64Fr¶   )ro   r   r×   r7   r¡   r–   rº   r^  ÚrealÚimagrX  rÔ   r¦   r‹   r§   rG   r  r­   Úexpand_dims)rK   ri   rj   rV  rl   r7   r9  rW  ÚavgÚsqrrv   s              r,   r^  r^  â  s²  € ðL ‡{�{�aÒä�GÔ.¨v°tÓ<Ó=Ð=Ø�L‰L€EÜ˜6 6¨4Ó0€DØ‡z�z�UÑà—‘˜tÓ$‰Ø	�‰�sÒ	ô Ø�K‰K˜d¨6¸À4ô
ä�6—;‘; T°&¸tÈ$ÔOñPð 	Pð ‡|�|×Ñ˜CÒÜ% f§l¡l°D¸$ÀÀfÇlÁlÓS‰ˆ‰qä% f§l¡l°D¸$ÀÓE‰ˆˆqàÐØ—‘“ˆä
�
‰
�6˜4¡f¡´"·&±&Ô9ð �*‰*˜$¤b§j¡jˆ*Ó
1°EÑ
9€CØÐÜ�n‰n˜S $Ó'ˆà�‰<˜AÑ
€CØÐÜ
�
‰
�3˜˜aÔ ô '+Ø! 3§7¡7°¼B¿J¹J 7Ó#GÈ!Ñ#Kó'€Fð ‡z�z�SÒØ—‘˜u¨5�Ó1ˆØ€Mr.   c               óÌ  — t        | ||||¬«       t        | ||«      }| j                  j                  dvr| j	                  d«      } t        j                  t
        j                  «      }| j                  j                  dk(  r| j                  }t        | j                  ||||«      \  }}t        | ||||¬«      }t        j                  |«      t        j                  |«      z  S )aà  
    Compute the standard error in the mean along given axis while ignoring NaNs

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    ddof : int, default 1
        Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
        where N represents the number of elements.
    mask : ndarray[bool], optional
        NA-mask if known

    Returns
    -------
    result : float64
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 2, 3])
    >>> nanops.nansem(s.values)
     np.float64(0.5773502691896258)
    rZ  rE  r‡   rV   )
r^  r¡   r7   r–   rº   r‹   r­   rX  rÔ   r]  )	rK   ri   rj   rV  rl   r8  r9  r  Úvars	            r,   Únansemrk  =  s·   € ôN ˆ6˜ V°$¸TÕBä˜6 6¨4Ó0€Dà‡|�|×Ñ Ñ$Ø—‘˜tÓ$ˆä—(‘(œ2Ÿ:™:Ó&€KØ‡|�|×Ñ˜CÒØ—l‘lˆÜ! &§,¡,°°d¸DÀ+ÓN�H€Eˆ1Ü
�˜d¨6¸À4Ô
H€Cä�7‰7�3‹<œ"Ÿ'™' %›.Ñ(Ð(r.   c                ó|   — t        j                  |j                  |¬«      |«      }t        j                  ||| «      S )a2  
    Replace every reduction slice of an object-dtype array that holds an NA
    with ``fill_value``.

    For ``skipna=False`` those slices are nulled out afterwards, so their values
    never reach the result and need not even support the operation being applied
    (GH#4147).  A float NaN propagates through arithmetic and comparison on its
    own; an object NA does not, and raises instead.

    Only for reductions over an axis of a 2-D array.  When the reduction covers
    the whole array the result is simply NA, and callers short-circuit instead.
    rÇ   )r‹   rf  rL   r¨   )rK   rl   ri   r›   Úany_nas        r,   r  r  t  s2   € ô$ �^‰^˜DŸH™H¨$˜HÓ/°Ó6€FÜ�8‰8�F˜J¨Ó/Ð/r.   c                ó4   — t        || j                  |   «      S )z‘
    ``min_count`` that nulls out any slice holding an NA, without weakening an
    explicit larger ``min_count`` from the caller (GH#4147).
    )r   rÔ   )rK   ri   r  s      r,   r  r  Š  s   € ô
 ˆy˜&Ÿ,™, tÑ,Ó-Ð-r.   c                ó2  — |j                  «       r&t        j                  | j                  |t        ¬«      S | j
                  dk(  s|€>t        j                  dt        ¬«      }| |    d   |d<   t        j                  ||| «      S t        j                  | j                  |¬«      |«      }t        j                  | ||¬«      }t        j                  |j                  |¬«      |«      }t        j                  |||«      }t        j                  ||| «      S )a!  
    Replace NA entries in an object-dtype array with a valid value taken from
    the same reduction slice.

    GH#65500: the +/-inf fill used for other dtypes is not comparable with
    arbitrary objects (Timestamps, strings, tuples) and raises.  Substituting a
    value already present in the slice cannot change a min/max, and for
    argmin/argmax a result landing on a filled position is corrected by
    ``_maybe_fix_arg_at_na``.  Entirely-NA slices get ``fill_value``, since
    their result is discarded by the caller either way.
    r²   rÒ   r   rÇ   )r  r‹   rÕ   rÔ   r…   rÓ   rO  r¨   rf  ÚargmaxÚtake_along_axis)rK   rl   ri   r›   rP  ÚindexerÚall_nas          r,   Ú_fill_object_nart  ’  sà   € ð" ‡x�x„zÜ�w‰w�v—|‘| Z´vÔ>Ð>Ø‡{�{�aÒ˜4˜<Ü�x‰x˜¤Ô(ˆð ˜$˜‘- Ñ"ˆˆQ‰Ü�x‰x˜˜d FÓ+Ð+Ü�n‰n˜t˜eŸ^™^°˜^Ó6¸Ó=€GÜ×Ñ˜f g°DÔ9€Dô �^‰^˜DŸH™H¨$˜HÓ/°Ó6€FÜ�8‰8�F˜J¨Ó-€DÜ�8‰8�D˜$ Ó'Ð'r.   rÇ   c               ó  — | j                   t        k(  rc|€t        | «      }|s|j                  «       rt	        d«      ‚|j                  «       r%t        | j                   |¬«      }t        | |||«      } | |fS t        | d||¬«      S )a¼  
    Prepare values for nanargmin/nanargmax by filling NA entries so that the
    comparison does not see them, and raise for ``skipna=False``.

    Mirrors ``_get_values(values, True, ...)`` except for object dtype, where
    the +/-inf fill is not comparable with arbitrary objects (GH#4147).  The
    object fill is a same-slice value, which *can* win the comparison; a result
    landing on it is corrected by ``_maybe_fix_arg_at_na``.
    ú)Encountered an NA value with skipna=False©rœ   T©rœ   rl   )r7   r…   r   rL   rP   r�   rt  rª   )rK   rœ   rl   rj   ri   r›   s         r,   Ú_get_arg_valuesry  ´  s{   € ð" ‡|�|”vÒØˆ<Ü˜“<ˆDÙ˜$Ÿ(™(œ*ô ÐHÓIÐIØ�8‰8Œ:Ü(¨¯©ÀnÔUˆJÜ$ V¨T°4¸ÓDˆFØ�tˆ|ÐÜ�v˜t°NÈÔNÐNr.   c                óf   ‡ ‡— t        d‰ › �¬«      t        d dd dœ	 	 	 	 	 	 	 dˆˆ fd„«       «       }|S )NrG   )rf   TrÅ   c          	     óê  •— | j                   dk(  rt        | |«      S | j                  }d}|t        k(  rt|€t	        | «      }|j                  «       rit        |‰¬«      }|rt        | |||«      } nK| j                  dk(  s|€t        | |«      S t        | |||«      } t        | ||«      }nt        | |‰|¬«      \  } } t        | ‰	«      |«      }t        |||| j                  ||j                  dv ¬«      }|S )Nr   rÒ   rw  rx  r    r  )ro   r×   r7   r…   r   rL   r�   rt  rÓ   r  r  rª   r|   r  rÔ   r–   )
rK   ri   rj   rl   r7   r  r›   rv   rœ   Úmeths
           €€r,   Ú	reductionz_nanminmax.<locals>.reductionÕ  s  ø€ ð �;‰;˜!ÒÜ$ V¨TÓ2Ð2à—‘ˆØˆ	Ø”FŠ?ð ˆ|Ü˜F“|�Ø�x‰xŒzÜ,¨UÀ>ÔR�
ÙÜ,¨V°T¸4ÀÓL‘FØ—[‘[ AÒ%¨¨ô -¨V°TÓ:Ð:ä4°V¸TÀ4ÈÓT�FÜ -¨f°d¸IÓ F‘Iä&Ø˜¨~ÀDô‰LˆF�Dð '”˜ Ó& tÓ,ˆÜ ØØØØ�L‰LØØŸ™ tÐ+ô
ˆð ˆr.   rÌ   )rd   rÏ   )r|  rœ   r}  s   `` r,   Ú
_nanminmaxr~  Ô  sb   ù€ Ü˜c $ ˜LÔ)Üð  $ØØ-1ñ*Øð*ð ð*ð ð	*ð
 +õ*ó ó *ð*ðX Ðr.   r"  r’   rw  r   ú-infc               ó„   — t        | d|||¬«      \  } }| j                  |«      }t        |||«      }t        ||||«      }|S )aî  
    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : int or ndarray[int]
        The index/indices  of max value in specified axis or -1 in the NA case

    Examples
    --------
    >>> from pandas.core import nanops
    >>> arr = np.array([1, 2, 3, np.nan, 4])
    >>> nanops.nanargmax(arr)
    np.int64(4)

    >>> arr = np.array(range(12), dtype=np.float64).reshape(4, 3)
    >>> arr[2:, 2] = np.nan
    >>> arr
    array([[ 0.,  1.,  2.],
           [ 3.,  4.,  5.],
           [ 6.,  7., nan],
           [ 9., 10., nan]])
    >>> nanops.nanargmax(arr, axis=1)
    array([2, 2, 1, 1])
    r  ©rœ   rl   rj   ri   )ry  rp  Ú_maybe_fix_arg_at_naÚ_maybe_arg_null_out©rK   ri   rj   rl   rv   s        r,   Ú	nanargmaxr…  
  óS   € ôL #Ø˜v¨D¸Àdô�L€FˆDð �]‰]˜4Ó €Fô " &¨$°Ó5€FÜ  ¨¨t°VÓ<€FØ€Mr.   c               ó„   — t        | d|||¬«      \  } }| j                  |«      }t        |||«      }t        ||||«      }|S )aí  
    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : int or ndarray[int]
        The index/indices of min value in specified axis or -1 in the NA case

    Examples
    --------
    >>> from pandas.core import nanops
    >>> arr = np.array([1, 2, 3, np.nan, 4])
    >>> nanops.nanargmin(arr)
    np.int64(0)

    >>> arr = np.array(range(12), dtype=np.float64).reshape(4, 3)
    >>> arr[2:, 0] = np.nan
    >>> arr
    array([[ 0.,  1.,  2.],
           [ 3.,  4.,  5.],
           [nan,  7.,  8.],
           [nan, 10., 11.]])
    >>> nanops.nanargmin(arr, axis=1)
    array([0, 0, 1, 1])
    r’   r�  )ry  Úargminr‚  rƒ  r„  s        r,   Ú	nanargminr‰  ;  r†  r.   c               óÆ  — | j                   }t        | «      } |�| j                  dk(  rn|dk(  ri| j                  j                  rdnd}t        j                  | j                  |«      ||�|j                  |«      nd«      }t        j                  |«      }n(|dv rt        j                  | |||«      }nt        d«      ‚|j                  dk(  r|j                  |d	¬
«      }|S )aÜ  
    Compute the sample skewness.

    The statistic computed here is the adjusted Fisher-Pearson standardized
    moment coefficient G1. The algorithm computes this coefficient directly
    from the second and third central moment.

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : float64
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 1, 2])
    >>> round(nanops.nanskew(s.values), 6)
    np.float64(1.732051)
    NrÒ   r   r    ÚC¾   r   rÒ   úaxis must be 0, 1 or NonerV   Fr¶   )r7   r   rÓ   rÜ   Úf_contiguousÚlibalgosÚscalar_skewrŽ   r‹   r­   Ú	axis_skewrP   r–   rº   ©rK   ri   rj   rl   r7   ÚorderÚresult_floatrv   s           r,   Únanskewr•  l  óÐ   € ðL �L‰L€EÜ˜FÓ#€Fð €|˜Ÿ™ qÒ(¨T°QªYØ*0¯,©,×*CÒ*C¡3ÈˆÜ×+Ñ+Ø�L‰L˜Ó ¸dÐ>N¨¯©°EÔ):ÐTXó
ˆô —‘˜LÓ)‰Ø	�‰Ü×#Ñ# F¨D°&¸$Ó?‰äÐ4Ó5Ð5à‡z�z�SÒØ—‘˜u¨5�Ó1ˆà€Mr.   c               óÆ  — | j                   }t        | «      } |�| j                  dk(  rn|dk(  ri| j                  j                  rdnd}t        j                  | j                  |«      ||�|j                  |«      nd«      }t        j                  |«      }n(|dv rt        j                  | |||«      }nt        d«      ‚|j                  dk(  r|j                  |d	¬
«      }|S )aÈ  
    Compute the sample excess kurtosis

    The statistic computed here is the adjusted Fisher-Pearson standardized
    moment coefficient G2, computed directly from the second and fourth
    central moment.

    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    result : float64
        Unless input is a float array, in which case use the same
        precision as the input array.

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, np.nan, 1, 3, 2])
    >>> round(nanops.nankurt(s.values), 6)
    np.float64(-1.289256)
    NrÒ   r   r    r‹  rŒ  r�  rV   Fr¶   )r7   r   rÓ   rÜ   rŽ  r�  Úscalar_kurtrŽ   r‹   r­   Ú	axis_kurtrP   r–   rº   r’  s           r,   Únankurtrš  §  r–  r.   c               óð  — t        | ||«      }| j                  t        k(  rK|sI|€t        | «      }|j	                  «       rE	 | j                  |«      }t        |||| j                  |¬«      S |r|�| j                  «       } d| |<   | j                  |«      }t        |||| j                  |¬«      S # t        $ r Y nw xY w| j                  dk(  s|€t        | |«      S t        | ||d«      } t        | ||«      }Œs)aä  
    Parameters
    ----------
    values : ndarray[dtype]
    axis : int, optional
    skipna : bool, default True
    min_count: int, default 0
    mask : ndarray[bool], optional
        nan-mask if known

    Returns
    -------
    Dtype
        The product of all elements on a given axis. ( NaNs are treated as 1)

    Examples
    --------
    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 2, 3, np.nan])
    >>> nanops.nanprod(s.values)
    np.float64(6.0)
    r  rÒ   )r¡   r7   r…   r   rL   Úprodr  rÔ   rO   rÓ   r×   r  r  r¦   )rK   ri   rj   r  rl   rv   s         r,   rƒ   rƒ   â  s  € ô@ ˜6 6¨4Ó0€Dà‡|�|”vÒ¡fàˆ<Ü˜“<ˆDØ�8‰8Œ:ðØŸ™ TÓ*�ô 'Ø˜D $¨¯©À	ôð ñ 
�DÐ$Ø—‘“ˆØˆˆt‰Ø�[‰[˜Ó€Fô Ø��d˜FŸL™L°Iôð øô% ò Ùðúð �{‰{˜aÒ 4 <ô )¨°Ó6Ð6Ü,¨V°T¸4ÀÓCˆFÜ% f¨d°IÓ>‰Is   ÁB0 Â0	B<Â;B<c                ó¾  — |�|j                  «       s| S |�|j                  dk(  rD|j                  «       |    r/|j                  «       s| j                  «       j	                  «       S | S t        j                  | |«      }t        j                  |||«      j                  |«      }|j                  «       r't        j                  || j	                  |«      | «      } | S )NrÒ   )
rL   rÓ   rŽ   r  rp  r‹   rf  rq  rJ  r¨   )rv   rl   ri   rr  Ú	arg_is_nas        r,   r‚  r‚  "  s·   € ð €|˜4Ÿ8™8œ:ØˆØ€|�t—y‘y A’~Ø�:‰:‹<˜Ò¨¯©¬
ð �E—=‘=“?×)Ñ)Ó+Ð+ð €Mô	 —.‘. ¨Ó.ˆÜ×&Ñ& t¨W°dÓ;×CÑCÀDÓIˆ	Ø�=‰=Œ?Ü—X‘X˜i¨4¨%¯©¸Ó)=¸vÓFˆFØ€Mr.   c                óT  — |€| S |�t        | dd«      s<|r|j                  «       rt        d«      ‚|s|j                  «       rt        d«      ‚| S |r*|j                  |«      j                  «       rt        d«      ‚|s*|j                  |«      j                  «       rt        d«      ‚| S )NrÓ   FzEncountered all NA valuesrv  )r|   r  rP   rL   )rv   ri   rl   rj   s       r,   rƒ  rƒ  ;  sž   € ð €|Øˆà€|œ7 6¨6°5Ô9Ù�d—h‘h”jÜÐ8Ó9Ð9Ù˜DŸH™HœJÜÐHÓIÐIð
 €Mñ	 
�D—H‘H˜T“N×&Ñ&Ô(ÜÐ4Ó5Ð5Ù˜Ÿ™ ›×*Ñ*Ô,ÜÐDÓEÐEØ€Mr.   c                óB  — |€F|�|j                   |j                  «       z
  }nt        j                  | «      }|j	                  |«      S |�"|j
                  |   |j                  |«      z
  }n| |   }t        |«      r|j	                  |«      S |j                  |d¬«      S )a¹  
    Get the count of non-null values along an axis

    Parameters
    ----------
    values_shape : tuple of int
        shape tuple from values ndarray, used if mask is None
    mask : Optional[ndarray[bool]]
        locations in values that should be considered missing
    axis : Optional[int]
        axis to count along
    dtype : type, optional
        type to use for count

    Returns
    -------
    count : scalar or array
    Fr¶   )ro   r  r‹   rœ  r5   rÔ   r   rº   )rU  rl   ri   r7   Únr9  s         r,   r6  r6  Q  s”   € ð0 €|ØÐØ—	‘	˜DŸH™H›JÑ&‰Aä—‘˜Ó%ˆAØ�z‰z˜!‹}ÐàÐØ—
‘
˜4Ñ  4§8¡8¨D£>Ñ1‰à˜TÑ"ˆä�%ÔØ�z‰z˜%Ó Ð Ø�<‰<˜ Eˆ<Ó*Ð*r.   c                ó¼  — |dk  r| S |��t        | t        j                  «      rç|�(|j                  |   |j	                  |«      z
  |z
  dk  }n/||   |z
  dk  }|d| ||dz   d z   }t        j
                  ||«      }t        j                  |«      rw|rt        | |<   | S t        | «      rZt        j                  | «      r| j                  d«      } nt        | «      s| j                  dd¬«      } t        j                  | |<   | S d| |<   | S | t        urHt        |||«      r;t        | dd«      }	t        |	«      r|	j!                  d	«      } | S t        j                  } | S )
zu
    Returns
    -------
    Dtype
        The product of all elements on a given axis. ( NaNs are treated as 1)
    r   NrÒ   Úc16r‡   Fr¶   r7   rG   )rŠ   r‹   rŒ   rÔ   r  Úbroadcast_torL   r   r   Úiscomplexobjrº   r   rG   r	   r  r|   r5   )
rv   ri   rl   rÔ   r  r©   Ú	null_maskÚbelow_countÚ	new_shapeÚresult_dtypes
             r,   r  r  z  sg  € ð �A‚~àˆàÑœJ v¬r¯z©zÔ:ØÐØŸ™ DÑ)¨D¯H©H°T«NÑ:¸YÑFÈ!ÑK‰Ið   ™+¨	Ñ1°AÑ5ˆKØ˜e˜t˜ u¨T°A©X¨ZÐ'8Ñ8ˆIÜŸ™¨°YÓ?ˆIä�6‰6�)ÔÙä$(��yÑ!ð& €Mô% " &Ô)Ü—?‘? 6Ô*Ø#Ÿ]™]¨5Ó1‘FÜ'¨Ô/Ø#Ÿ]™]¨4°e˜]Ó<�FÜ$&§F¡F��yÑ!ð €Mð %)��yÑ!ð €Mð 
”sÑ	Ü  ¨¨iÔ8Ü" 6¨7°DÓ9ˆLÜ˜lÔ+à%×*Ñ*¨5Ó1�ð €Mô Ÿ™�à€Mr.   c                ó„   — |dkD  r;|€t        j                  | «      }n|j                  |j                  «       z
  }||k  ryy)aÅ  
    Check for the `min_count` keyword. Returns True if below `min_count` (when
    missing value should be returned from the reduction).

    Parameters
    ----------
    shape : tuple
        The shape of the values (`values.shape`).
    mask : ndarray[bool] or None
        Boolean numpy array (typically of same shape as `shape`) or None.
    min_count : int
        Keyword passed through from sum/prod call.

    Returns
    -------
    bool
    r   TF)r‹   rœ  ro   r  )rÔ   rl   r  Ú	non_nullss       r,   r  r  ®  s?   € ð( �1‚}Øˆ<äŸ™ ›‰IàŸ	™	 D§H¡H£JÑ.ˆIØ�yÒ ØØr.   Úpearson)ÚmethodÚmin_periodsc               ó@  — t        | «      t        |«      k7  rt        d«      ‚|€d}t        | «      t        |«      z  }|j                  «       s
| |   } ||   }t        | «      |k  rt        j
                  S t        | «      } t        |«      }t        |«      } || |«      S )z
    a, b: ndarrays
    z'Operands to nancorr must have same sizerÒ   )rm   ÚAssertionErrorr   r  r‹   rG   rù   Úget_corr_func)ÚaÚbr­  r®  ÚvalidrV   s         r,   Únancorrrµ  Í  s–   € ô ˆ1ƒv”�Q“ÒÜÐFÓGÐGàÐØˆä�!‹H”u˜Q“xÑ€EØ�9‰9Œ;Øˆe‰HˆØˆe‰Hˆä
ˆ1ƒv�ÒÜ�v‰vˆä˜Ó€AÜ˜Ó€Aä�fÓ€AÙˆQ�‹7€Nr.   c                óš   ‡‡— | dk(  rddl mŠ ˆfd„}|S | dk(  rddl mŠ ˆfd„}|S | dk(  rd	„ }|S t        | «      r| S t	        d
| › d�«      ‚)NÚkendallr   )Ú
kendalltauc                ó   •—  ‰| |«      d   S ©Nr   r€   )r²  r³  r¸  s     €r,   rÊ   zget_corr_func.<locals>.funcó  s   ø€ Ù˜a Ó# AÑ&Ð&r.   Úspearman)Ú	spearmanrc                ó   •—  ‰| |«      d   S rº  r€   )r²  r³  r¼  s     €r,   rÊ   zget_corr_func.<locals>.funcú  s   ø€ Ù˜Q “? 1Ñ%Ð%r.   r¬  c                ó   — t        | |«      S r(   )Ú_pearson_corr)r²  r³  s     r,   rÊ   zget_corr_func.<locals>.func   s   € Ü   AÓ&Ð&r.   zUnknown method 'z@', expected one of 'kendall', 'spearman', 'pearson', or callable)Úscipy.statsr¸  r¼  ÚcallablerP   )r­  rÊ   r¸  r¼  s     @@r,   r±  r±  í  sr   ù€ ð �ÒÝ*ô	'ð ˆØ	�:Ò	Ý)ô	&ð ˆØ	�9Ò	ò	'ð ˆÜ	�&Ô	Øˆä
Ø
˜6˜(ð #8ð 	8óð r.   c                óD  — | j                   dk7  s9|j                   dk7  s*t        j                  | «      st        j                  |«      rt        j                  | |«      d   S t	        | «      dk  rt        j
                  S | j                  t        j                  d¬«      } |j                  t        j                  d¬«      }| | j                  «       z
  } ||j                  «       z
  }t        j                  t        j                  | «      «      }t        j                  t        j                  |«      «      }|dk(  s|dk(  rt        j
                  S | |z  } ||z  }t	        | «      dz
  }t        j                  t        j                  | | «      |z  «      }|dk(  rt        j
                  S t        j                  | |«      |z  |z  }t        j                  t        j                  ||«      |z  «      }|dk(  rt        j
                  S t        j                  ||z  dd«      S )	NrÒ   ©r   rÒ   rÚ   Fr¶   r   g      ð¿ç      ð?)rÓ   r‹   r¥  Úcorrcoefrm   rG   rº   r­   Úmeanr   r¿   r]  ÚdotÚclip)r²  r³  Úa_scaleÚb_scaleÚfactÚdivisorrv   s          r,   r¿  r¿    s�  € Ø‡v�v�‚{�a—f‘f ’k¤R§_¡_°QÔ%7¼2¿?¹?È1Ô;MÜ�{‰{˜1˜aÓ  Ñ&Ð&ä
ˆ1ƒv�‚zÜ�v‰vˆà	�‰”—‘ %ˆÓ(€AØ	�‰”—‘ %ˆÓ(€Aà	ˆA�F‰F‹H‰€AØ	ˆA�F‰F‹H‰€AÜ�f‰f”R—V‘V˜A“YÓ€GÜ�f‰f”R—V‘V˜A“YÓ€Gà�!‚|�w !’|Ü�v‰vˆà	ˆG‰€AØ	ˆG‰€AÜˆq‹6�A‰:€DÜ�g‰g”b—f‘f˜Q “l TÑ)Ó*€Gà�!‚|Ü�v‰vˆä�V‰V�A�q‹\˜DÑ  7Ñ*€FÜ�g‰g”b—f‘f˜Q “l TÑ)Ó*€Gà�!‚|Ü�v‰vˆä�7‰7�6˜GÑ# T¨3Ó/Ð/r.   )r®  rV  c               óN  — t        | «      t        |«      k7  rt        d«      ‚|€d}t        | «      t        |«      z  }|j                  «       s
| |   } ||   }t        | «      |k  rt        j
                  S t        | «      } t        |«      }t	        j                  | ||¬«      d   S )Nz&Operands to nancov must have same sizerÒ   rY  rÃ  )rm   r°  r   r  r‹   rG   rù   Úcov)r²  r³  r®  rV  r´  s        r,   ÚnancovrÏ  0  s™   € ô ˆ1ƒv”�Q“ÒÜÐEÓFÐFàÐØˆä�!‹H”u˜Q“xÑ€EØ�9‰9Œ;Øˆe‰HˆØˆe‰Hˆä
ˆ1ƒv�ÒÜ�v‰vˆä˜Ó€AÜ˜Ó€Aä�6‰6�!�Q˜TÔ" 4Ñ(Ð(r.   c          	     ó¢  — t         j                  dt         j                  ft         j                  j                  t         j
                   t         j                  ft         j                  dt         j                  ft         j                  j                  t         j
                  t         j                  fi|   \  }}| j                  j                  dvsJ ‚|rot        | j                  j                  t         j                  t         j                  f«      s1| j                  «       }t        |«      }|||<    ||d¬«      }|||<   |S  || d¬«      }|S )a  
    Cumulative function with skipna support.

    Parameters
    ----------
    values : np.ndarray or ExtensionArray
    accum_func : {np.cumprod, np.maximum.accumulate, np.cumsum, np.minimum.accumulate}
    skipna : bool

    Returns
    -------
    np.ndarray or ExtensionArray
    rÄ  g        r    r   rÇ   )r‹   ÚcumprodrG   ÚmaximumÚ
accumulater•   ÚcumsumÚminimumr7   r–   rA   r5   r±   Úbool_r¦   r   )rK   Ú
accum_funcrj   Úmask_aÚmask_bÚvalsrl   rv   s           r,   Úna_accum_funcrÛ  L  s   € ô 	�
‰
�Sœ"Ÿ&™&�MÜ
�
‰
×Ñ¤§¡ ¬¯©Ð0Ü
�	‰	�CœŸ™�=Ü
�
‰
×Ñ¤§¡¬¯©Ð/ð	ð
 ñ�N€FˆFð �<‰<×Ñ DÑ(Ð(Ð(ñ ”j §¡×!2Ñ!2´R·Z±ZÄÇÁÐ4JÔKØ�{‰{‹}ˆÜ�D‹zˆØˆˆT‰
Ù˜D qÔ)ˆØˆˆt‰ð €Mñ ˜F¨Ô+ˆà€Mr.   )T)r+   r_   r\   r]   )r7   r   rf   Ústrr\   r_   r^   )NN)r7   r   r›   zScalar | None)rK   rz   rj   r_   rl   rÍ   r\   rÍ   )NNN)rK   rz   rj   r_   r›   r   rœ   z
str | Nonerl   rÍ   r\   ú/tuple[np.ndarray, npt.NDArray[np.bool_] | None])r7   únp.dtyper\   rÞ  )r7   r   r\   r_   )r7   rÞ  )rÊ   r    r\   r    )rK   rz   ri   r{   r\   zScalar | np.ndarray)rK   rz   r\   rz   )rõ   r   r\   rû   )rõ   r   r\   r_   )rK   rz   r\   r…   )r  rÜ  r\   rÜ  )
rK   rz   ri   r{   rj   r_   rl   rÍ   r\   r_   )rK   rz   ri   r{   rj   r_   r  r!  rl   rÍ   r\   ú'np.ndarray | np.int64 | float | NaTType)rK   rz   ri   r{   rl   rÍ   rj   r_   r  r!  r\   znp.ndarray | np.int64)
rv   z+np.ndarray | np.datetime64 | np.timedelta64ri   r{   rl   únpt.NDArray[np.bool_]rÉ   rz   r\   z5np.ndarray | np.datetime64 | np.timedelta64 | NaTType)
rK   rz   ri   r{   rj   r_   rl   rÍ   r\   r3  )rK   rz   ri   r{   rj   r_   r\   zfloat | np.ndarray)rÔ   r"   ri   r   r\   rz   )rU  r"   rl   rÍ   ri   r{   rV  r!  r7   rÞ  r\   z-tuple[float | np.ndarray, float | np.ndarray])ri   r{   rj   r_   rV  r!  )rK   rz   ri   r{   rj   r_   rV  r!  )rK   rz   ri   r{   rj   r_   rV  r!  rl   rÍ   r\   r3  )
rK   rz   rl   rà  ri   r   r›   r   r\   rz   )rK   rz   ri   r   r  r!  r\   r!  )
rK   rz   rl   rà  ri   r{   r›   r   r\   rz   )rK   rz   rœ   rÜ  rl   rÍ   rj   r_   ri   r{   r\   rÝ  )
rK   rz   ri   r{   rj   r_   rl   rÍ   r\   zint | np.ndarray)
rK   rz   ri   r{   rj   r_   rl   rÍ   r\   znp.ndarray | float)rK   rz   ri   r{   rj   r_   r  r!  rl   rÍ   r\   r3  )rv   rz   rl   rÍ   ri   r{   r\   rz   )
rv   rz   ri   r{   rl   rÍ   rj   r_   r\   znp.ndarray | int)
rU  r"   rl   rÍ   ri   r{   r7   znp.dtype[np.floating]r\   z&np.floating | npt.NDArray[np.floating])rÒ   F)rv   rß  ri   r{   rl   rÍ   rÔ   útuple[int, ...]r  r!  r©   r_   r\   rß  )rÔ   rá  rl   rÍ   r  r!  r\   r_   )
r²  rz   r³  rz   r­  r   r®  ú
int | Noner\   r3  )r­  r   r\   z)Callable[[np.ndarray, np.ndarray], float])r²  rz   r³  rz   r\   r3  )
r²  rz   r³  rz   r®  râ  rV  râ  r\   r3  )rK   r   rj   r_   r\   r   )pÚ
__future__r   rY   rI   Útypingr   r   r   r   rë   Únumpyr‹   Úpandas._config.configr   ÚconfigÚpandas._libsr	   r
   r   r   Úpandas._libs.algosÚ_libsÚalgosr�  Úpandas._libs.tslibsr   Úpandas.compat._optionalr   Úpandas.core.dtypes.commonr   r   r   r   r   r   r   r   Úpandas.core.dtypes.missingr   r   r   Úcollections.abcr   Úpandas._typingr   r   r   r   r   r    r!   r"   r#   r}   r)   r*   r-   r2   rd   rp   rs   r�   r¡   rª   r¯   r”   rÃ   rÏ   r×   rå   rù   rð   rþ   rò   r  r  r  r  r‚   r  rÈ   r„   rA  rK  r7   r­   rX  r`  r^  rk  r  r  rt  ry  r~  ÚnanminÚnanmaxr…  r‰  r•  rš  rƒ   r‚  rƒ  r6  r  r  rµ  r±  r¿  rÏ  rÛ  r€   r.   r,   ú<module>rô     sÇ	  ðÝ "ã Û ÷ó ó ã å :÷ó ÷ &Ð %Ý 4Ý >÷	÷ 	ó 	÷ñ ñ Ý(÷
÷ 
õ 
ñ   °VÔ<€Ø $˜Ð Ø€ôñ �6˜)Ñ$Ð%5Ñ6Ô 7÷ñ ÷>3ñ 3óló(
ð GKðØðØ!.óð@$Øð$Ø $ð$Ø,Hð$à!ó$ðT Ø!%Ø)-ðDØðDàðDð ðDð ð	Dð
 'ðDð 5óDóN	ó2ô0óf0ófEó>óBTón'óóó	ó	ð  ØØ)-ñ5Øð5ð ð5ð ð	5ð
 'ð5ð 
ó5ðv  ØØ)-ñ5Øð5ð ð5ð ð	5ð
 'ð5ð 
ó5ñp 
ˆ$ƒØØð  ØØØ)-ñGØðGð ðGð ð	Gð
 ðGð 'ðGð -òGó ó ó ðGðTQ2ØðQ2à
ðQ2ð 'ðQ2ð ð	Q2ð
 ðQ2ð óQ2ðhØ7ðà
ðð  ðð ð	ð
 ;óð  ÙÓØð  ØØ)-ñ@Øð@ð ð@ð ð	@ð
 'ð@ð ò@ó ó ó ð@ðF ÙÓà26ÀtÐRVñg%Øðg%Ø!/ðg%Ø@Dðg%àòg%ó ó ðg%ðTØðà
ðð óð8 �b—h‘h˜rŸz™zÓ*ð-Øð-à
&ð-ð ð-ð ð	-ð
 ð-ð 3ó-ð` Ù˜Ôð  ØØØ	ñ/-ð ð/-ð ð	/-ð
 ò/-ó ó ð/-ðd Ù	ˆ$�ÓÙ˜Ôð  ØØØ	ñUØðUð ðUð ð	Uð
 òUó ó ó ðUðp Ù	ˆ$�Óð  ØØØ)-ñ2)Øð2)ð ð2)ð ð	2)ð
 ð2)ð 'ð2)ð ò2)ó ó ð2)ðj0Øð0à
ð0ð ð0ð ð	0ð
 ó0ó,.ð(Øð(à
ð(ð ð(ð ð	(ð
 ó(ðP  ñOØðOð ðOð 'ð	Oð
 ðOð ðOð 5óOò@/ñd 
�E¨&Ô	1€Ù	�E¨&Ô	1€ð  ØØ)-ñ.Øð.ð ð.ð ð	.ð
 'ð.ð ó.ðh  ØØ)-ñ.Øð.ð ð.ð ð	.ð
 'ð.ð ó.ðb Ù	ˆ$�ÓØð  ØØ)-ñ5Øð5ð ð5ð ð	5ð
 'ð5ð ò5ó ó ó ð5ðp Ù	ˆ$�ÓØð  ØØ)-ñ5Øð5ð ð5ð ð	5ð
 'ð5ð ò5ó ó ó ð5ñp 
ˆ$�ÓØð  ØØØ)-ñ;Øð;ð ð;ð ð	;ð
 ð;ð 'ð;ð ò;ó ó ð;ð|Øðà
&ðð ðð ó	ð2Øðà
ðð 'ðð ð	ð
 óð4 $, 2§8¡8¨B¯J©JÓ#7ð	&+Øð&+à
&ð&+ð ð&+ð !ð	&+ð
 ,ó&+ð\ Øð1Ø3ð1à
ð1ð 'ð1ð ð	1ð
 ð1ð ð1ð -ó1ðhØðØ">ðØKNðà	óñ> 
ˆ$�Óð
 !*Ø"ñØðàðð ð	ð
 ðð òó ðð>Øðà.óó@ 0ñF 
ˆ$�Óð
 #Øñ)Øð)àð)ð ð	)ð
 ð)ð ò)ó ð)ô6"r.   