+
    ŜiX                    $   ^ RI Ht ^ RIt^ RIt^ RIHtHtHt ^ RIt^ RI	t
^ RIHt ^ RIHtHtHtHt ^ RIHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHtH t H!t!H"t"H#t#H$t$H%t%H&t& ^ R	I'H(t(H)t)H*t* ]'       d   ^ R
I+H,t, ]! RRR7      t-]-RJt.Rs/RqR R llt0]0! ]! R4      4        ! R R4      t1 ! R R4      t2R R lt3R R lt4RrR R llt5R R lt6RsR R  llt7R! R" lt8R# R$ lt9RtR% R& llt:R' R( lt;R) R* lt<R+ R, lt=R-RR.RR/R/R0 R1 llt>R-RR.RR/R/R2 R3 llt?]1! R44      ];]=R-RR.RR5^ R/R/R6 R7 ll4       4       4       t@R8 R9 ltA]2! 4       ];R-RR.RR/R/R: R; ll4       4       tB]2! 4       R-RR.RR/R/R< R= ll4       tCR> R? ltD]
P                  ! ]
P                  4      3R@ RA lltG]2! ^RB7      R-RR.RRC^R/R/RD RE ll4       tH]1! R4RF4      ]2! ^RB7      R-RR.RRC^R/R/RG RH ll4       4       tI]1! R4RF4      R-RR.RRC^R/R/RI RJ ll4       tJRK tK]K! RLRMRN7      tL]K! RORPRN7      tMR-RR.RR/R/RQ RR lltNR-RR.RR/R/RS RT lltO]1! R4RF4      ]=R-RR.RR/R/RU RV ll4       4       tP]1! R4RF4      ]=R-RR.RR/R/RW RX ll4       4       tQ]1! R4RF4      ]=R-RR.RR5^ R/R/RY RZ ll4       4       tRR[ R\ ltS]
P                  ! ]
P                  4      3R] R^ lltTRuR_ R` lltURa Rb ltVRc Rd ltW]1! R4RF4      ReRfRgR/Rh Ri ll4       tXRj Rk ltY]1! R4RF4      RgRRC^/Rl Rm ll4       tZRn t[Ro Rp lt\R# )v    )annotationsN)TYPE_CHECKINGAnycast)
get_option)NaTNaTTypeiNaTlib)		ArrayLikeAxisIntCorrelationMethodDtypeDtypeObjFScalarShapenpt)import_optional_dependency)
is_complex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
bottleneckwarn)errorsFTc                    V ^8  d   QhRRRR/# )   vboolreturnNone )formats   "[/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/pandas/core/nanops.py__annotate__r.   ;   s      $ $     c                &    \         '       d   V sR # R # N)_BOTTLENECK_INSTALLED_USE_BOTTLENECK)r'   s   &r-   set_use_bottleneckr4   ;   s      r/   zcompute.use_bottleneckc                  F   a  ] tR t^EtR V 3R lltR R ltR R ltRtV ;t# )disallowc                    V ^8  d   QhRRRR/# )r&   dtypesr   r)   r*   r+   )r,   s   "r-   r.   disallow.__annotate__F   s     J J J$ Jr/   c                	   < \         SV `  4        \        ;QJ d    . R  V 4       F  NK  	  5V n        R# ! R  V 4       4      V n        R# )c              3  L   "   T F  p\        V4      P                  x  K  	  R # 5ir1   )r   type).0dtypes   & r-   	<genexpr>$disallow.__init__.<locals>.<genexpr>H   s     I&L/44&s   "$N)super__init__tupler8   )selfr8   	__class__s   &*r-   rB   disallow.__init__F   s2    eI&IeeI&IIr/   c                   V ^8  d   QhRR/# r&   r)   r(   r+   )r,   s   "r-   r.   r9   J   s     Q QD Qr/   c                	~    \        VR 4      ;'       d+    \        VP                  P                  V P                  4      # r>   )hasattr
issubclassr>   r<   r8   )rD   objs   &&r-   checkdisallow.checkJ   s*    sG$PPCIINNDKK)PPr/   c                    V ^8  d   QhRRRR/# )r&   fr   r)   r+   )r,   s   "r-   r.   r9   M   s      !  r/   c                	f   a a \         P                  ! S4      VV 3R  l4       p\        \        V4      # )c                   < \         P                  ! WP                  4       4      p\        ;QJ d    V3R  lV 4       F  '       g   K   RM	  RM! V3R  lV 4       4      '       d,   SP                  P                  RR4      p\        RV R24      h S! V / VB #   \         d+   p\        T ^ ,          4      '       d   \        T4      Thh Rp?ii ; i)c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir1   )rN   )r=   rM   rD   s   & r-   r?   0disallow.__call__.<locals>._f.<locals>.<genexpr>Q   s     7hs4::c??hs   !TFnan zreduction operation 'z' not allowed for this dtypeN)		itertoolschainvaluesany__name__replace	TypeError
ValueErrorr   )argskwargsobj_iterf_nameerQ   rD   s   *,   r-   _fdisallow.__call__.<locals>._fN   s     t]]_=Hs7h7sss7h777++E26+F83OP 	$)&)) 
 #47++#A,A-s   B C%%C

C	functoolswrapsr   r   )rD   rQ   re   s   ff r-   __call__disallow.__call__M   s,    			 
	$ Ar{r/   )r8   )	r\   
__module____qualname____firstlineno__rB   rN   rj   __static_attributes____classcell__)rE   s   @r-   r6   r6   E   s    J JQ r/   r6   c                  2    ] tR t^dtRR R lltR R ltRtR# )bottleneck_switchNc                   V ^8  d   QhRR/# )r&   r)   r*   r+   )r,   s   "r-   r.   bottleneck_switch.__annotate__e   s      t r/   c                	    Wn         W n        R # r1   )namera   )rD   rv   ra   s   &&,r-   rB   bottleneck_switch.__init__e   s    	r/   c                    V ^8  d   QhRRRR/# )r&   altr   r)   r+   )r,   s   "r-   r.   rt   i   s     0 0A 0! 0r/   c                	  a aaa S P                   ;'       g    SP                  o \        \        S4      o\        P                  ! S4      RR RR/R VVVV 3R lll4       p\        \        V4      #   \        \
        3 d    R o LPi ; i)NaxisskipnaTc               $    V ^8  d   QhRRRRRR/# )r&   rZ   
np.ndarrayr{   AxisInt | Noner|   r(   r+   )r,   s   "r-   r.   0bottleneck_switch.__call__.<locals>.__annotate__r   s(     %	 %	%	 !%	 	%	r/   c               4  < \        S
P                  4      ^ 8  d0   S
P                  P                  4        F  w  rEWC9  g   K  WSV&   K  	  V P                  ^ 8X  d   VP	                  R4      f   \        W4      # \        '       d   V'       d~   \        V P                  S	4      '       db   VP	                  RR4      f>   VP                  RR4       S! V 3RV/VB p\        V4      '       d   S! V 3RVRV/VB pV# S! V 3RVRV/VB p V# S! V 3RVRV/VB pV# )r   	min_countNmaskr{   r|   )lenra   itemssizeget_na_for_min_countr3   _bn_ok_dtyper>   pop	_has_infs)rZ   r{   r|   kwdskr'   resultry   bn_funcbn_namerD   s   &$$,   r-   rQ   %bottleneck_switch.__call__.<locals>.fq   s    4;;!# KK--/DA}"#Q 0 {{aDHH[$9$A )666l6<<.Q.Q88FD)1 HHVT*$V?$?$?F !((!$V!N$!Nv!N!N M	 !JdJ6JTJF M VF$FvFFMr/   )
rv   r\   getattrbnAttributeError	NameErrorrh   ri   r   r   )rD   ry   rQ   r   r   s   ff @@r-   rj   bottleneck_switch.__call__i   s    ))++s||	b'*G 
	%	 $(%	  	%	 %	 
%	N AqzW 	* 	G	s   A1 1BB)ra   rv   r1   )r\   rl   rm   rn   rB   rj   ro   r+   r/   r-   rr   rr   d   s    0 0r/   rr   c               $    V ^8  d   QhRRRRRR/# )r&   r>   r   rv   strr)   r(   r+   )r,   s   "r-   r.   r.      s!         r/   c                H    V \         8w  d   \        V 4      '       g   VR9  # R# )nansumF)r   nanprodnanmean)objectr   )r>   rv   s   &&r-   r   r      s%    2599 ;;;r/   c                   V ^8  d   QhRR/# rH   r+   )r,   s   "r-   r.   r.      s     
 
 
r/   c                (   \        V \        P                  4      '       d7   V P                  R9   d&   \        P
                  ! V P                  R4      4      #  \        P                  ! V 4      P                  4       #   \        \        3 d     R# i ; i)f8KF)r   f4)
isinstancenpndarrayr>   r   has_infsravelisinfr[   r^   NotImplementedError)r   s   &r-   r   r      sn    &"**%%<<<' <<S 122xx##%%*+ s   #A< <BBc                    V ^8  d   QhRRRR/# )r&   r>   r   
fill_valuezScalar | Noner+   )r,   s   "r-   r.   r.      s      !.r/   c                    Ve   V# \        V 4      '       d=   Vf   \        P                  # VR8X  d   \        P                  # \        P                  ) # VR8X  d   \        P
                  # \        # )z9return the correct fill value for the dtype of the values+inf)_na_ok_dtyper   rV   infr   i8maxr
   )r>   r   fill_value_typs   &&&r-   _get_fill_valuer      s]     E!66Mv%66MFF7N	6	!yyr/   c               (    V ^8  d   QhRRRRRRRR/# )r&   rZ   r~   r|   r(   r   npt.NDArray[np.bool_] | Noner)   r+   )r,   s   "r-   r.   r.      s,     ) )) $),H)!)r/   c                    VfL   V P                   P                  R9   d   R# V'       g   V P                   P                  R9   d   \        V 4      pV# )a^  
Compute a mask if and only if necessary.

This function will compute a mask iff it is necessary. Otherwise,
return the provided mask (potentially None) when a mask does not need to be
computed.

A mask is never necessary if the values array is of boolean or integer
dtypes, as these are incapable of storing NaNs. If passing a NaN-capable
dtype that is interpretable as either boolean or integer data (eg,
timedelta64), a mask must be provided.

If the skipna parameter is False, a new mask will not be computed.

The mask is computed using isna() by default. Setting invert=True selects
notna() as the masking function.

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)r>   kindr   )rZ   r|   r   s   &&&r-   _maybe_get_maskr      sA    B |<<%V\\&&$.<DKr/   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   rZ   r~   r|   r(   r   r   r   z
str | Noner   r   r)   z/tuple[np.ndarray, npt.NDArray[np.bool_] | None]r+   )r,   s   "r-   r.   r.      sL     D DDD D 	D
 'D 5Dr/   c                   \        WV4      pV P                  pRpV P                  P                  R9   d(   \        P                  ! V P                  R4      4      p RpV'       d   Ve   \        WRVR7      pVer   VP                  4       '       d\   V'       g   \        V4      '       d+   V P                  4       p \        P                  ! WV4       W3# \        P                  ! V( W4      p W3# )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   r>   r   r   asarrayviewr   r[   r   copyputmaskwhere)rZ   r|   r   r   r   r>   datetimelikes   &&&&&  r-   _get_valuesr      s    R 640DLLEL||D  FKK-.4# %

 !xxzz<#6#6#[[]FJJvZ8
 <  XXteV@F<r/   c                    V ^8  d   QhRRRR/# )r&   r>   np.dtyper)   r+   )r,   s   "r-   r.   r.   D  s     	 	( 	x 	r/   c                P   T pV P                   R 9   d'   \        P                  ! \        P                  4      pV# V P                   R8X  d'   \        P                  ! \        P                  4      pV# V P                   R8X  d%   \        P                  ! \        P
                  4      pV# )biurQ   )r   r   r>   int64uint64float64)r>   	dtype_maxs   & r-   _get_dtype_maxr   D  s{    IzzTHHRXX&	
 	 
s	HHRYY'	  
s	HHRZZ(	r/   c                    V ^8  d   QhRRRR/# )r&   r>   r   r)   r(   r+   )r,   s   "r-   r.   r.   P  s     2 2 2T 2r/   c                z    \        V 4      '       d   R # \        V P                  \        P                  4      '       * # )F)r   rL   r<   r   integerrJ   s   &r-   r   r   P  s(    5!!%**bjj111r/   c                   V ^8  d   QhRR/# )r&   r>   r   r+   )r,   s   "r-   r.   r.   V  s     & & &r/   c                   V \         J d    V # VP                  R8X  d   Vf   \        p\        V \        P
                  4      '       g   \        V4      '       d   Q R4       hW8X  d   \        P                  p \        V 4      '       d(   \        P                  ! RR4      P                  V4      p M%\        P                  ! V 4      P                  V4      p V P                  VRR7      p V # V P                  V4      p  V # VP                  R8X  d   \        V \        P
                  4      '       g   W8X  g   \        P                  ! V 4      '       d(   \        P                  ! R4      P                  V4      p V # \        P                  ! V 4      \        P                   8  d   \#        R4      h\        P                  ! V 4      P                  VRR7      p  V # V P                  R	4      P                  V4      p V # )
zwrap our results if neededMzExpected non-null fill_valuer   nsFr   mzoverflow in timedelta operationzm8[ns])r   r   r
   r   r   r   r   rV   
datetime64astyper   r   isnantimedelta64fabsr   r   r_   )r   r>   r   s   &&&r-   _wrap_resultsr   V  s   }F MC 
s	J&"**--J''G)GG'#F||ud3::5A&)..u5]]5u]5F& M! ]]5)F  M 
s	&"**--#rxx'7'7.55e< M 399, !BCC &)00U0C
 M ]]8,11%8FMr/   c                    V ^8  d   QhRRRR/# r&   funcr   r)   r+   )r,   s   "r-   r.   r.     s      q Q r/   c                x   a  \         P                  ! S 4      RRRRRR/R V 3R lll4       p\        \        V4      # )z
If we have datetime64 or timedelta64 values, ensure we have a correct
mask before calling the wrapped function, then cast back afterwards.
r{   Nr|   Tr   c               (    V ^8  d   QhRRRRRRRR/# 	r&   rZ   r~   r{   r   r|   r(   r   r   r+   )r,   s   "r-   r.   *_datetimelike_compat.<locals>.__annotate__  s2        	
 +r/   c          	       < T pV P                   P                  R 9   pV'       d   Vf   \        V 4      pS! V 3RVRVRV/VB pV'       d6   \        WuP                   \        R7      pV'       g   Vf   Q h\        WqW54      pV# )r   r{   r|   r   )r   )r>   r   r   r   r
   _mask_datetimelike_result)	rZ   r{   r|   r   ra   orig_valuesr   r   r   s	   &$$$,   r-   new_func&_datetimelike_compat.<locals>.new_func  s     ||((D0DL<DfL4LLTLVL"6+<+<NF'''26Sr/   rg   )r   r   s   f r-   _datetimelike_compatr     sR     __T  $ 	
 .2  0 8r/   c               $    V ^8  d   QhRRRRRR/# )r&   rZ   r~   r{   r   r)   zScalar | np.ndarrayr+   )r,   s   "r-   r.   r.     s'     E Ej E ECV Er/   c                N   V P                   P                  R9   d   V P                  R4      p \        V P                   4      pV P                  ^8X  d   V# Vf   V# V P
                  RV V P
                  V^,           R ,           p\        P                  ! W2V P                   R7      # )aQ  
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   NrJ   )r>   r   r   r   ndimshaper   full)rZ   r{   r   result_shapes   &&  r-   r   r     s    " ||G#y)#FLL1J{{a	||ET*V\\$(*-EEww|v||DDr/   c                    V ^8  d   QhRRRR/# r   r+   )r,   s   "r-   r.   r.     s       a r/   c                p   a  \         P                  ! S 4      RR/R V 3R lll4       p\        \        V4      # )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.
r{   Nc                    V ^8  d   QhRRRR/# )r&   rZ   r~   r{   r   r+   )r,   s   "r-   r.   +maybe_operate_rowwise.<locals>.__annotate__  s     1 1
 1^ 1r/   c          	     T  < V^8X  Ed   V P                   ^8X  d   V P                  R,          '       d   V P                  ^,          R,          V P                  ^ ,          8  d   V P                  \        \
        39  d   \        V 4      pVP                  R4      eK   VP                  R4      p\        \        V4      4       Uu. uF  pS! W5,          3RWE,          /VB NK  	  ppMV Uu. uF  pS! V3/ VB NK  	  pp\        P                  ! V4      # S! V 3RV/VB # u upi u upi )   C_CONTIGUOUS  r   r{   )r   flagsr   r>   r   r(   listr   r   ranger   r   array)	rZ   r{   ra   arrsr   iresultsxr   s	   &$,     r-   newfunc&maybe_operate_rowwise.<locals>.newfunc  s    AIq ^,, a4'6<<?:VTN2<Dzz&!-zz&)CHTCSCSaD9tw9&9CS   7;;d4,V,d;88G$$F0000 <s    D +D%rg   )r   r  s   f r-   maybe_operate_rowwiser    s;     __T1d 1 1 1, 7r/   r{   r|   r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# 
r&   rZ   r~   r{   r   r|   r(   r   r   r)   r+   )r,   s   "r-   r.   r.     <     5 55 5 	5
 '5 
5r/   c               D   V P                   P                  R9   d   Vf   V P                  V4      # V P                   P                  R8X  d   \        R4      h\	        WRVR7      w  rV P                   \
        8X  d   V P                  \        4      p V P                  V4      # )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   z0datetime64 type does not support operation 'any'Fr   r   )r>   r   r[   r^   r   r   r   r(   rZ   r{   r|   r   _s   &$$$ r-   nananyr    s    D ||E!dl zz$||CJKKFu4HIF ||vt$ ::dr/   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# r  r+   )r,   s   "r-   r.   r.     r  r/   c               D   V P                   P                  R9   d   Vf   V P                  V4      # V P                   P                  R8X  d   \        R4      h\	        WRVR7      w  rV P                   \
        8X  d   V P                  \        4      p V P                  V4      # )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   z0datetime64 type does not support operation 'all'Tr	  )r>   r   allr^   r   r   r   r(   r
  s   &$$$ r-   nanallr    s    D ||E!dl zz$||CJKKFt$GIF ||vt$ ::dr/   M8r   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   rZ   r~   r{   r   r|   r(   r   intr   r   r)   z*npt.NDArray[np.floating] | float | NaTTyper+   )r,   s   "r-   r.   r.   T  sF     * ** * 	*
 * '* 0*r/   c               :   V P                   p\        W^ VR7      w  r\        V4      pVP                  R8X  d   TpM5VP                  R8X  d%   \        P                   ! \        P
                  4      pV P                  WR7      p\        WqW@P                  VR7      pV# )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	  rQ   r   rJ   r   )	r>   r   r   r   r   r   sum_maybe_null_outr   )rZ   r{   r|   r   r   r>   	dtype_sumthe_sums   &$$$$   r-   r   r   Q  s~    D LLEv!$GLFu%IzzS		s	HHRZZ(	jjj/GgT<<9UGNr/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r&   r   z+np.ndarray | np.datetime64 | np.timedelta64r{   r   r   znpt.NDArray[np.bool_]r   r~   r)   z5np.ndarray | np.datetime64 | np.timedelta64 | NaTTyper+   )r,   s   "r-   r.   r.     s:      7
   	
 ;r/   c                d   \        V \        P                  4      '       dG   V P                  R 4      P	                  VP
                  4      p VP                  VR7      p\        W&   V # VP                  4       '       d4   \        P                  ! \        4      P	                  VP
                  4      # V # )r   r{   )	r   r   r   r   r   r>   r[   r
   r   )r   r{   r   r   	axis_masks   &&&& r-   r   r     s     &"**%%t$))+*;*;<HH$H'	  M 
xx~"";#4#455Mr/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r&   rZ   r~   r{   r   r|   r(   r   r   r)   floatr+   )r,   s   "r-   r.   r.     sC     @ @@ @ 	@
 '@ @r/   c                  V P                   \        8X  d)   \        V 4      R8  d   Vf   \        V R,          WR7       V P                   p\	        W^ VR7      w  r\        V4      p\        P                   ! \        P                  4      pVP                  R9   d&   \        P                   ! \        P                  4      pMKVP                  R9   d&   \        P                   ! \        P                  4      pMVP                  R8X  d   TpTp\        V P                  W1VR	7      pV P                  WR	7      p\        V4      pVe   \        VR
R4      '       d{   \        \        P                  V4      p\        P                   ! RR7      ;_uu_ 4        W,          p	RRR4       V^ 8H  p
V
P#                  4       '       d   \        P$                  X	V
&   X	# V^ 8  d	   W,          M\        P$                  p	V	#   + '       g   i     La; i)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   N:Ni  N)r{   r|   r	  r   iurQ   rJ   r   Fignore)r  )r>   r   r   r   r   r   r   r   r   _get_countsr   r  _ensure_numericr   r   r   errstater[   rV   )rZ   r{   r|   r   r>   r  dtype_countcountr  the_meanct_masks   &$$$       r-   r   r     sp   B ||v#f+"5$,uD8LLEv!$GLFu%I((2::&K zzTHHRZZ(		t	HHRZZ(		s		dDEjjj/Gg&GGGVU;;RZZ'[[X&&H ' 1*;;== "HW O ',ai7?RVVO '&s   	G11H	c               (    V ^8  d   QhRRRRRRRR/# )	r&   rZ   r~   r{   r   r|   r(   r)   float | np.ndarrayr+   )r,   s   "r-   r.   r.     s2     h% h%h%!/h%@Dh%h%r/   c               *  a V P                   P                  R8H  ;'       d    VRJ pRR V3R lllpV P                   p\        V SVRR7      w  rV P                   P                  R8w  dT   V P                   \        8X  d-   \        P
                  ! V 4      pVR9   d   \        RV  R24      h V P                  R4      p V'       gC   Ve?   V P                  P                  '       g   V P                  4       p \        P                  W&   V P                  p	V P                   ^8  Ed
   VEe   V	'       d   S'       g   \        P"                  ! WQV 4      p
M\$        P&                  ! 4       ;_uu_ 4        \$        P(                  ! R	R
\*        4       V P,                  ^,          ^8X  d   V^ 8X  g    V P,                  ^ ,          ^8X  d5   V^8X  d.   \        P.                  ! \        P0                  ! V 4      RR7      p
M\        P.                  ! WR7      p
RRR4       M7\3        V P,                  V4      p
M V	'       d	   V! W4      M\        P                  p
\5        X
V4      #   \         d   p\        \        T4      4      ThRp?ii ; i  + '       g   i     LD; i)a  
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 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
rQ   Nc                   V ^8  d   QhRR/# )r&   r   r~   r+   )r,   s   "r-   r.   nanmedian.<locals>.__annotate__  s      j r/   c                  < Vf   \        V 4      pMV( pS'       g'   VP                  4       '       g   \        P                  # \        P
                  ! 4       ;_uu_ 4        \        P                  ! RR\        4       \        P                  ! RR\        4       \        P                  ! W,          4      pR R R 4       V#   + '       g   i     X# ; i)Nr#  All-NaN slice encounteredzMean of empty slice)	r    r  r   rV   warningscatch_warningsfilterwarningsRuntimeWarning	nanmedian)r   _maskresr|   s   && r-   
get_mediannanmedian.<locals>.get_median  s    =!HEFEeiikk66M$$&&##5~ ##H.C^T,,qx(C ' 
 '& 
s    AB??C	)r   r   zCannot convert  to numericr   r#  r1  T)keepdimsr  r1   stringmixed)r>   r   r   r   r   infer_dtyper^   r   r_   r   r   	writeabler   r   rV   r   r   apply_along_axisr2  r3  r4  r5  r   r6  squeeze_get_empty_reduction_resultr   )rZ   r{   r|   r   using_nan_sentinelr9  r>   inferrederrnotemptyr8  s   &$d$       r-   r6  r6    s   B  **c1BBddl   LLEvvDTJLF||C<<6!v.H../& EFF	/]]4(F $"2||%%%[[]Fvv{{H
 {{Q4+))*FC ,,..++ "=~ Q1,Q1, !ll2::f+=M ll6= /.$ .fllDAC +3j&e$$Y  	/CH%3.	/* /.s%   ,I /BJI?%I::I?J	c               $    V ^8  d   QhRRRRRR/# )r&   r   r   r{   r   r)   r~   r+   )r,   s   "r-   r.   r.   B  s&      
 r/   c                   \         P                  ! V 4      p\         P                  ! \        V 4      4      p\         P                  ! W#V8g  ,          \         P
                  R7      pVP                  \         P                  4       V# )z
The result from a reduction on an empty ndarray.

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

Returns
-------
np.ndarray
rJ   )r   r   aranger   emptyr   fillrV   )r   r{   shpdimsrets   &&   r-   rD  rD  B  sS      ((5/C99SZ D
((3t|$BJJ
7CHHRVVJr/   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   values_shaper   r   r   r{   r   ddofr  r>   r   r)   z-tuple[float | np.ndarray, float | np.ndarray]r+   )r,   s   "r-   r.   r.   Y  sD     / //
&/ / 	/
 / 3/r/   c                   \        WW$R7      pWTP                  V4      ,
          p\        V4      '       d*   WS8:  d!   \        P                  p\        P                  pWV3# \        \        P                  V4      pWS8*  pVP                  4       '       dK   \        P                  ! Wa\        P                  4       \        P                  ! WQ\        P                  4       WV3# )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 : int, np.nan or np.ndarray
d : int, np.nan or np.ndarray
rJ   )	r$  r<   r   r   rV   r   r   r[   r   )rR  r   r{   rS  r>   r(  ds   &&&&&  r-   _get_counts_nanvarrV  Y  s    : D>E

4  A = FFEA 8O RZZ'}88::JJq'JJuBFF+8Or/   rS  rS  c               $    V ^8  d   QhRRRRRR/# )r&   r{   r   r|   r(   rS  r  r+   )r,   s   "r-   r.   r.     s*     +- +- +- 	+-
 +-r/   c          
     @   V P                   P                  R8X  d=   \        P                  ! V P                   4      ^ ,          pV P	                  RV R24      p V P                   p\        WVR7      w  r\        P                  ! \        WW#VR7      4      p\        Wv4      # )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
    nan-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   zm8[])r   r{   r|   rS  r   )	r>   r   r   datetime_datar   r   sqrtnanvarr   )rZ   r{   r|   rS  r   unit
orig_dtyper   s   &$$$$   r-   nanstdra    s    H ||C-a0s4&]+JvD9LFWWVFfdSTF,,r/   m8c               (    V ^8  d   QhRRRRRRRR/# )	r&   rZ   r~   r{   r   r|   r(   rS  r  r+   )r,   s   "r-   r.   r.     s8     J JJ J 	J
 Jr/   c                  V P                   p\        WV4      pVP                  R9   d(   V P                  R4      p Ve   \        P
                  W&   V P                   P                  R8X  d%   \        V P                  WAW0P                   4      w  rgM\        V P                  WAV4      w  rgV'       d,   Ve(   V P                  4       p \        P                  ! W^ 4       \        V P                  V\        P                  R7      4      V,          pVe   \        P                  ! W4      pV P                   P                  R8X  d#   \        \        W,
          4      ^,          4      p	M\        W,
          ^,          4      p	Ve   \        P                  ! W^ 4       V	P                  V\        P                  R7      V,          p
VP                  R8X  d   V
P                  VRR7      p
V
# )aU  
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
    nan-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"  r   rQ   )r{   r>   cFr   )r>   r   r   r   r   rV   rV  r   r   r   r%  r  r   expand_dimsabs)rZ   r{   r|   rS  r   r>   r(  rU  avgsqrr   s   &$$$$      r-   r^  r^    si   J LLE640DzzTt$66FL||C%fllDllSq%fllDE$"


6# &**$bjj*A
BU
JCnnS'||Cc#,/145s|12


3a WW$bjjW1A5F
 zzSu51Mr/   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   rZ   r~   r{   r   r|   r(   rS  r  r   r   r)   r   r+   )r,   s   "r-   r.   r.   
  sF     1) 1)1) 1) 	1)
 1) '1) 1)r/   c                  \        WW#VR7       \        WV4      pV P                  P                  R8w  d   V P	                  R4      p V'       g+   Ve'   VP                  4       '       d   \        P                  # \        V P                  WAW0P                  4      w  rV\        WW#VR7      p\        P                  ! V4      \        P                  ! V4      ,          # )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
    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, 2, 3])
>>> nanops.nansem(s.values)
 np.float64(0.5773502691896258)
r[  rQ   r   )r^  r   r>   r   r   r[   r   rV   rV  r   r]  )rZ   r{   r|   rS  r   r(  r  vars   &$$$$   r-   nansemrm  	  s    L 6VTB640D||Ct$d&488::vv!&,,D,,OHE
64
HC773<"''%.((r/   c                d   a a \        R S  2R7      \        RRRRRR/R VV 3R lll4       4       pV# )	rV   )rv   r{   Nr|   Tr   c               (    V ^8  d   QhRRRRRRRR/# r   r+   )r,   s   "r-   r.    _nanminmax.<locals>.__annotate__A  s2        	
 +r/   c                  < V P                   ^ 8X  d   \        W4      # V P                  p\        WSVR7      w  r\	        V S4      ! V4      p\        WQW0P                  VP                  R9   R7      pV# )r   r   r   r   )r   )r   r   r>   r   r   r  r   r   )rZ   r{   r|   r   r>   r   r   meths   &$$$  r-   	reduction_nanminmax.<locals>.reduction?  sp     ;;!$V22">
 &t, $5::;M
 r/   )rr   r   )rs  r   rt  s   ff r-   
_nanminmaxrv  >  sS    c$L)  $ 	
 .2   *( r/   minr   )r   max-infc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r&   rZ   r~   r{   r   r|   r(   r   r   r)   zint | np.ndarrayr+   )r,   s   "r-   r.   r.   \  <     + ++ + 	+
 '+ +r/   c               b    \        V RRVR7      w  rV P                  V4      p\        WAW24      pV# )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])
Try  rr  )r   argmax_maybe_arg_null_outrZ   r{   r|   r   r   s   &$$$ r-   	nanargmaxr  \  8    L vtFNLF]]4 F !t<FMr/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r{  r+   )r,   s   "r-   r.   r.     r|  r/   c               b    \        V RRVR7      w  rV P                  V4      p\        WAW24      pV# )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])
Tr   rr  )r   argminr  r  s   &$$$ r-   	nanargminr    r  r/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r  r+   )r,   s   "r-   r.   r.     sC     T TT T 	T
 'T Tr/   c               &   \        WV4      pV P                  P                  R8w  d)   V P                  R4      p \	        V P
                  W14      pM"\	        V P
                  W1V P                  R7      pV'       d-   Ve)   V P                  4       p \        P                  ! W^ 4       M2V'       g+   Ve'   VP                  4       '       d   \        P                  # \        P                  ! RRR7      ;_uu_ 4        V P                  V\        P                  R7      V,          pRRR4       Ve   \        P                  ! XV4      pV X,
          pV'       d   Ve   \        P                  ! Wc^ 4       V^,          pWv,          pVP                  V\        P                  R7      p	VP                  V\        P                  R7      p
\        P                  ! V 4      P!                  VRR7      p\        P"                  ! V	P                  4      P$                  pW,          ^,          V,          pW,          ^,          V,          p\'        W4      p	\'        W4      p
\        P                  ! RRR7      ;_uu_ 4        WD^,
          R	,          ,          V^,
          ,          WR
,          ,          ,          pRRR4       V P                  pVP                  R8X  d   XP                  VRR7      p\)        X\        P*                  4      '       d3   \        P,                  ! V	^ 8H  ^ V4      p\        P                  W^8  &   V# V	^ 8X  d   VP/                  ^ 4      MTpV^8  d   \        P                  # V#   + '       g   i     ELT; i  + '       g   i     L; i)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])
>>> nanops.nanskew(s.values)
np.float64(1.7320508075688787)
rQ   r   rJ   Nr#  invaliddivide        initialg      ?g      ?Fr   )r   r>   r   r   r$  r   r   r   r   r[   rV   r&  r  r   rf  rg  rx  finfoeps_zero_out_fperrr   r   r   r<   )rZ   r{   r|   r   r(  meanadjusted	adjusted2	adjusted3m2m3max_absr  constant_tolerance2constant_tolerance3r   r>   s   &$$$             r-   nanskewr    s   J 640D||Ct$FLL$5FLL$FLLI$"


6#(TXXZZvv	Xh	7	7zz$bjjz1E9 
8~~dD)}H$"


81%!I$I	t2::	.B	t2::	.B ffVn  s 3G
((288

 
 CMa/58Ma/58		1B		1B	Xh	7	719,,	:rG|L 
8 LLEzzSu51&"**%%"'1f-FFqy M	 #%'Av1966MMI 
8	7	7* 
8	7s   8)M,69N ,M=	 N	c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r  r+   )r,   s   "r-   r.   r.     sC     r rr r 	r
 'r rr/   c                  \        WV4      pV P                  P                  R8w  d)   V P                  R4      p \	        V P
                  W14      pM"\	        V P
                  W1V P                  R7      pV'       d-   Ve)   V P                  4       p \        P                  ! W^ 4       M2V'       g+   Ve'   VP                  4       '       d   \        P                  # \        P                  ! RRR7      ;_uu_ 4        V P                  V\        P                  R7      V,          pRRR4       Ve   \        P                  ! XV4      pV X,
          pV'       d   Ve   \        P                  ! Wc^ 4       V^,          pV^,          pVP                  V\        P                  R7      p	VP                  V\        P                  R7      p
\        P                  ! V 4      P!                  VRR7      p\        P"                  ! V	P                  4      P$                  pW,          ^,          V,          pW,          ^,          V,          p\'        W4      p	\'        W4      p
\        P                  ! RRR7      ;_uu_ 4        ^V^,
          ^,          ,          V^,
          V^,
          ,          ,          pWD^,           ,          V^,
          ,          V
,          pV^,
          V^,
          ,          V	^,          ,          pRRR4       \)        X\        P*                  4      '       g:   V^8  d   \        P                  # V^ 8X  d   V P                  P-                  ^ 4      # \        P                  ! RRR7      ;_uu_ 4        XV,          X,
          pRRR4       V P                  pVP                  R8X  d   XP                  VR	R
7      p\)        X\        P*                  4      '       d2   \        P.                  ! V^ 8H  ^ V4      p\        P                  VV^8  &   V#   + '       g   i     EL; i  + '       g   i     EL:; i  + '       g   i     L; i)al  
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])
>>> nanops.nankurt(s.values)
np.float64(-1.2892561983471076)
rQ   r   rJ   Nr#  r  r  r  Fr   )r   r>   r   r   r$  r   r   r   r   r[   rV   r&  r  r   rf  rg  rx  r  r  r  r   r   r<   r   )rZ   r{   r|   r   r(  r  r  r  	adjusted4r  m4r  r  r  constant_tolerance4adj	numeratordenominatorr   r>   s   &$$$                r-   nankurtr    s   J 640D||Ct$FLL$5FLL$FLLI$"


6#(TXXZZvv	Xh	7	7zz$bjjz1E9 
8~~dD)}H$"


81%!I1I	t2::	.B	t2::	.B0 ffVn  s 3G
((288

 
 CMa/58Ma/58		1B		1B	Xh	7	7519""uqyUQY&?@QY'5195:	qyUQY/"a%7 
8
 k2::.. 1966M!<<$$Q''	Xh	7	7[(3. 
8 LLEzzSu51&"**%%+*Av6FFuqyME 
8	7	7T 
8	7	7 
8	7s%   8)P7A=P%5P9P"	%P6	9Q		c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   rZ   r~   r{   r   r|   r(   r   r  r   r   r)   r   r+   )r,   s   "r-   r.   r.     sF     ( (( ( 	(
 ( '( (r/   c                   \        WV4      pV'       d   Ve   V P                  4       p ^W&   V P                  V4      p\        WQW@P                  VR7      # )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   prodr  r   )rZ   r{   r|   r   r   r   s   &$$$$ r-   r   r     sS    @ 640D$"[[F dLLI r/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r&   r   r~   r{   r   r   r   r|   r(   r)   znp.ndarray | intr+   )r,   s   "r-   r.   r.     s:      
 ' 	
 r/   c                   Vf   V # Ve   \        V RR4      '       gU   V'       d"   VP                  4       '       d   \        R4      hV'       g"   VP                  4       '       d   \        R4      hV # V'       d1   VP                  V4      P                  4       '       d   \        R4      hV'       g1   VP                  V4      P                  4       '       d   \        R4      hV # )Nr   FzEncountered all NA valuesz)Encountered an NA value with skipna=False)r   r  r_   r[   )r   r{   r   r|   s   &&&&r-   r  r    s     ||766599dhhjj899DHHJJHII
 M	 
DHHTN&&((455**,,DEEMr/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r&   rR  r   r   r   r{   r   r>   znp.dtype[np.floating]r)   z&np.floating | npt.NDArray[np.floating]r+   )r,   s   "r-   r.   r.     s:     &+ &+&+
&&+ &+ !	&+
 ,&+r/   c                z   VfN   Ve#   VP                   VP                  4       ,
          pM\        P                  ! V 4      pVP	                  V4      # Ve+   VP
                  V,          VP                  V4      ,
          pMW,          p\        V4      '       d   VP	                  V4      # VP                  VRR7      # )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   )r   r  r   r  r<   r   r   r   )rR  r   r{   r>   nr(  s   &&&&  r-   r$  r$    s    0 |		DHHJ&A%Azz!}

4 488D>1"%zz%  <<E<**r/   c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r&   r   znp.ndarray | float | NaTTyper{   r   r   r   r   tuple[int, ...]r   r  r   r(   r)   r+   )r,   s   "r-   r.   r.     sN     1 1(1
1 '1 	1
 1 1 "1r/   c                f   Vf
   V^ 8X  d   V # VEeB   \        V \        P                  4      '       Ed!   Ve5   VP                  V,          VP	                  V4      ,
          V,
          ^ 8  pM=W1,          V,
          ^ 8  pVRV W1^,           R ,           p\        P
                  ! Wx4      p\        P                  ! V4      '       d   V'       d   \        W&   V # \        V 4      '       dg   \        P                  ! V 4      '       d   V P                  R4      p M$\        V 4      '       g   V P                  RRR7      p \        P                  W&   V # RW&   V # V \        JdT   \        W2V4      '       dB   \        V RR4      p	\        V	4      '       d   V	P!                  R4      p V # \        P                  p V # )za
Returns
-------
Dtype
    The product of all elements on a given axis. ( NaNs are treated as 1)
Nc16r   Fr   r>   rV   )r   r   r   r   r  broadcast_tor[   r
   r   iscomplexobjr   r   rV   r   check_below_min_countr   r<   )
r   r{   r   r   r   r   	null_maskbelow_count	new_shaperesult_dtypes
   &&&&&&    r-   r  r    sr    |	QJvrzz::D)DHHTN:YF!KI  +	1A5KetuAXZ'88I?I66)$(!& M% "&))??6**#]]51F'//#]]4e]<F$&FF! M %)! M 
s	 i88"67D9Ll++%**51 M Mr/   c               (    V ^8  d   QhRRRRRRRR/# )	r&   r   r  r   r   r   r  r)   r(   r+   )r,   s   "r-   r.   r.   (  s,      ">KN	r/   c                    V^ 8  dE   Vf   \         P                  ! V 4      pM!VP                  VP                  4       ,
          pW28  d   R# R# )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
TF)r   r  r   r  )r   r   r   	non_nullss   &&& r-   r  r  (  s=    ( 1}<I		DHHJ.I r/   c                   V ^8  d   QhRR/# )r&   tolr,  r+   )r,   s   "r-   r.   r.   G  s     ? ?0 ?r/   c                   \        V \        P                  4      '       d0   \        P                  ! \        P                  ! V 4      V8  ^ V 4      # \        P                  ! V 4      V8  d   V P
                  P                  ^ 4      # T # r   )r   r   r   r   rg  r>   r<   )argr  s   &&r-   r  r  G  sZ    #rzz""xxsc)1c22$&FF3K#$5syy~~a >3>r/   methodpearsonmin_periodsc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r&   ar~   br  r   r  
int | Noner)   r   r+   )r,   s   "r-   r.   r.   P  s:       	
  r/   c               j   \        V 4      \        V4      8w  d   \        R4      hVf   ^p\        V 4      \        V4      ,          pVP                  4       '       g   W,          p W,          p\        V 4      V8  d   \        P
                  # \        V 4      p \        V4      p\        V4      pV! W4      # )z
a, b: ndarrays
z'Operands to nancorr must have same size)r   AssertionErrorr    r  r   rV   r%  get_corr_func)r  r  r  r  validrQ   s   &&$$  r-   nancorrr  O  s     1vQFGG!HuQxE99;;HH
1vvvAAfAQ7Nr/   c                    V ^8  d   QhRRRR/# )r&   r  r   r)   z)Callable[[np.ndarray, np.ndarray], float]r+   )r,   s   "r-   r.   r.   o  s      .r/   c                   aa V R 8X  d   ^ RI Ho V3R lpV# V R8X  d   ^ RI Ho V3R lpV# V R8X  d   R pV# \        V 4      '       d   V # \	        RV  R	24      h)
kendall)
kendalltauc                "   < S! W4      ^ ,          # r  r+   )r  r  r  s   &&r-   r   get_corr_func.<locals>.funcu  s    a#A&&r/   spearman)	spearmanrc                "   < S! W4      ^ ,          # r  r+   )r  r  r  s   &&r-   r   r  |  s    Q?1%%r/   r  c                <    \         P                  ! W4      R,          # )r   r   r   )r   corrcoef)r  r  s   &&r-   r   r    s    ;;q$T**r/   zUnknown method 'z@', expected one of 'kendall', 'spearman', 'pearson', or callable)scipy.statsr  r  callabler_   )r  r   r  r  s   & @@r-   r  r  o  su     *	' 	:	)	& 	9		+ 	&		

6( #8 	8 r/   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r&   r  r~   r  r  r  rS  r)   r   r+   )r,   s   "r-   r.   r.     s:     ) ))) 	)
 ) )r/   c                  \        V 4      \        V4      8w  d   \        R 4      hVf   ^p\        V 4      \        V4      ,          pVP                  4       '       g   W,          p W,          p\        V 4      V8  d   \        P
                  # \        V 4      p \        V4      p\        P                  ! WVR7      R,          # )z&Operands to nancov must have same sizerW  r  )r   r  r    r  r   rV   r%  cov)r  r  r  rS  r  s   &&$$ r-   nancovr    s     1vQEFF!HuQxE99;;HH
1vvvAA66!T"4((r/   c                   \        V \        P                  4      '       d   V P                  P                  R 9   d"   V P                  \        P                  4      p V # V P                  \        8X  d   \        P                  ! V 4      pVR9   d   \        RV  R24      h V P                  \        P                  4      p \        P                  ! \        P                  ! V 4      4      '       g   V P                  p V #  V # \!        V 4      '       gV   \#        V 4      '       gE   \%        V 4      '       g4   \        V \&        4      '       d   \        RV  R24      h \)        V 4      p V # V #   \        \        3 dH     T P                  \        P                  4      p  T #   \         d   p\        RT  R24      ThRp?ii ; ii ; i  \        \        3 d4     \+        T 4      p  T #   \         d   p\        RT  R24      ThRp?ii ; ii ; i)r   zCould not convert r;  NzCould not convert string 'z' to numericr=  )r   r   r   r>   r   r   r   r   r   r@  r^   
complex128r[   imagrealr_   r   r   r   r   r   complex)r   rF  rG  s   &  r-   r%  r%    s   !RZZ  77<<5 $A< H; WWq)H.."4QC{ CDD
HHR]]+ vvbggaj))A H; : H qkkZ]]jmma8<HII	NaA H1H- z* RR,A( H' " R#&8;$GHcQRR :& 	NNAJ H  N"4QC{ CD#MN		NsT   E' G 'F?9FF;&F66F;;F?HG""H-G==HHc               $    V ^8  d   QhRRRRRR/# )r&   rZ   r   r|   r(   r)   r+   )r,   s   "r-   r.   r.     s!     " ") "D "Y "r/   c          	        \         P                  R\         P                  3\         P                  P                  \         P
                  ) \         P                  3\         P                  R\         P                  3\         P                  P                  \         P
                  \         P                  3/V,          w  r4V P                  P                  R9  g   Q hV'       dt   \        V P                  P                  \         P                  \         P                  34      '       g0   V P                  4       p\        V4      pW5V&   V! V^ R7      pWGV&   V# V! V ^ R7      pV# )z
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
g      ?r  r   r  )r   cumprodrV   maximum
accumulater   cumsumminimumr>   r   rL   r<   r   bool_r   r   )rZ   
accum_funcr|   mask_amask_bvalsr   r   s   &&$     r-   na_accum_funcr    s     	

S"&&M


0
		C=


/	
 NF <<D((( j!2!2RZZ4JKK{{}DzT
Dq)t M F+Mr/   )T)NN)NNNr1   )r   F)]
__future__r   rh   rX   typingr   r   r   r2  numpyr   pandas._configr   pandas._libsr   r	   r
   r   pandas._typingr   r   r   r   r   r   r   r   r   pandas.compat._optionalr   pandas.core.dtypes.commonr   r   r   r   r   r   r   r   pandas.core.dtypes.missingr   r   r    collections.abcr!   r   r2   r3   r4   r6   rr   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r   r   r6  rD  r>   r   rV  ra  r^  rm  rv  nanminnanmaxr  r  r  r  r   r  r$  r  r  r  r  r  r  r%  r  r+   r/   r-   <module>r     s   "   
   % 
 
 
 ?	 	 	  (V<$  :67 8 >5 5p(
()XDN	2&RDE>B5  5 	5
 *.5p5  5 	5
 *.5p 
$*  * 	*
 * *.*   *Z  @  @ 	@
 *.@  @F h%26h%GKh%RVh% h%V8 hhrzz*/d +-  +- 	+-
 +- 
+- +-\ 
$J  J 	J
 J 
J  JZ 
$1)  1) 	1)
 1) *.1) 1)h4 
E&	1	E&	1+  + 	+
 *.+\+  + 	+
 *.+\ 
$T  T 	T
 *.T  Tn 
$r  r 	r
 *.r  rj 
$(  ( 	(
 ( *.(  (V4 $&88BJJ#7	&+R1h>? 
$ !*	
 # >@ 
$) #	)
 ) )6!H"r/   