Ë
    ¤eh(Ç  ã                  óÊ  — d dl mZ d dlZd dlZd dl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ZmZmZmZmZmZmZmZ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dd¬«      Z-e-duZ.da/dKdLd„Z0 e0 ed«      «        G d„ d«      Z1 G d„ d«      Z2dMd„Z3dNd„Z4	 dO	 	 	 dPd„Z5	 	 	 	 	 	 	 	 dQd„Z6	 	 	 dR	 	 	 	 	 	 	 	 	 	 	 dSd„Z7dTd„Z8dUd„Z9dVdWd„Z:dXd„Z;dYd„Z<dXd „Z=dddd!œ	 	 	 	 	 	 	 	 	 dZd"„Z>dddd!œ	 	 	 	 	 	 	 	 	 dZd#„Z? e1d$«      e;e=ddd dd%œ	 	 	 	 	 	 	 	 	 	 	 d[d&„«       «       «       Z@	 	 	 	 	 	 	 	 	 	 d\d'„ZA e2«       e;dddd!œ	 	 	 	 	 	 	 	 	 d]d(„«       «       ZB e2«       dddd!œd^d)„«       ZC	 	 	 	 	 	 d_d*„ZD e
jŠ                  e
jŒ                  «      f	 	 	 	 	 	 	 	 	 	 	 d`d+„ZG e2d,¬-«      ddd,dd.œ	 	 	 	 	 dad/„«       ZH e1d$d0«       e2d,¬-«      ddd,dd.œ	 	 	 	 	 	 	 dbd1„«       «       ZI e1d$d0«      ddd,dd.œ	 	 	 	 	 	 	 	 	 	 	 dcd2„«       ZJd3„ ZK eKd4d5¬6«      ZL eKd7d8¬6«      ZMdddd!œ	 	 	 	 	 	 	 	 	 ddd9„ZNdddd!œ	 	 	 	 	 	 	 	 	 ddd:„ZO e1d$d0«      e=dddd!œ	 	 	 	 	 	 	 	 	 d]d;„«       «       ZP e1d$d0«      e=dddd!œ	 	 	 	 	 	 	 	 	 d]d<„«       «       ZQ e1d$d0«      e=ddd dd%œ	 	 	 	 	 	 	 	 	 	 	 d[d=„«       «       ZR	 	 	 	 	 	 	 	 	 	 ded>„ZS e
jŠ                  e
jŒ                  «      f	 	 	 	 	 	 	 	 	 dfd?„ZT	 dg	 	 	 	 	 	 	 	 	 	 	 dhd@„ZU	 	 	 	 	 	 	 	 didA„ZVdB„ ZW e1d$d0«      dCddDœ	 	 	 	 	 	 	 	 	 djdE„«       ZX	 	 	 	 dkdF„ZY e1d$d0«      dd,dGœ	 	 	 	 	 	 	 	 	 dldH„«       ZZdI„ Z[dmdJ„Z\y)né    )ÚannotationsN)ÚAnyÚCallableÚcast)Ú
get_option)ÚNaTÚNaTTypeÚiNaTÚlib)	Ú	ArrayLikeÚAxisIntÚCorrelationMethodÚDtypeÚDtypeObjÚFÚScalarÚShapeÚnpt)Úimport_optional_dependency)Úfind_stack_level)Ú
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Ú
bottleneckÚwarn)ÚerrorsFTc                ó   — t         r| ay y ©N)Ú_BOTTLENECK_INSTALLEDÚ_USE_BOTTLENECK)Úvs    úP/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pandas/core/nanops.pyÚset_use_bottleneckr+   9   s   € õ Ø‰ð ó    z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>F   s   è ø€ ÒI¸œL¨Ó/×4Õ4ÑIùs   ‚!)ÚsuperÚ__init__ÚtupleÚdtypes)Úselfr8   Ú	__class__s     €r*   r6   zdisallow.__init__D   s    ø€ Ü‰ÑÔÜÑIÀ&ÔIÓIˆ�r,   c                ór   — t        |d«      xr* t        |j                  j                  | j                  «      S )Nr3   )ÚhasattrÚ
issubclassr3   r1   r8   )r9   Úobjs     r*   Úcheckzdisallow.checkH   s'   € Ü�s˜GÓ$ÒP¬°C·I±I·N±NÀDÇKÁKÓ)PÐPr,   c                ób   ‡ ‡— t        j                  ‰«      ˆˆ fd„«       }t        t        |«      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&   )r?   )r2   r>   r9   s     €r*   r4   z0disallow.__call__.<locals>._f.<locals>.<genexpr>O   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Úfr9   s        €€r*   Ú_fzdisallow.__call__.<locals>._fL   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©Ú	functoolsÚwrapsr   r   )r9   rR   rS   s   `` r*   Ú__call__zdisallow.__call__K   s,   ù€ Ü	�‰˜Ó	ô	ó 
ð	ô$ ”A�r‹{Ðr,   )r8   r   ÚreturnÚNone©rX   Úbool)rR   r   rX   r   )rI   Ú
__module__Ú__qualname__r6   r?   rW   Ú__classcell__)r:   s   @r*   r.   r.   C   s   ø„ õJóQ÷r,   r.   c                  ó   — e Zd Zddd„Zdd„Zy)Úbottleneck_switchNc                ó    — || _         || _        y r&   )ÚnamerN   )r9   rb   rN   s      r*   r6   zbottleneck_switch.__init__c   s   € ØˆŒ	Øˆ�r,   c                ó  ‡ ‡‡‡— ‰ j                   xs ‰j                  Š	 t        t        ‰«      Št        j                  ‰«      d ddœ	 	 	 	 	 dˆˆˆˆ fd„«       }t        t        |«      S # t        t
        f$ r d ŠY ŒMw xY w)NT©ÚaxisÚskipnac               óè  •— t        ‰
j                  «      dkD  r,‰
j                  j                  «       D ]  \  }}||vsŒ|||<   Œ | j                  dk(  r|j	                  d«      €t        | |«      S t        rn|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   Ú	min_countÚmaskre   rd   )ÚlenrN   ÚitemsÚsizeÚgetÚ_na_for_min_countr(   Ú_bn_ok_dtyper3   ÚpopÚ	_has_infs)rG   re   rf   ÚkwdsÚkr)   ÚresultÚaltÚbn_funcÚbn_namer9   s          €€€€r*   rR   z%bottleneck_switch.__call__.<locals>.fo   s  ø€ ô �4—;‘;Ó !Ò#Ø ŸK™K×-Ñ-Ó/ò $‘D�A�qØ ’}Ø"#˜˜Qšð$ð �{‰{˜aÒ D§H¡H¨[Ó$9Ð$Aô )¨°Ó6Ð6å¡6¬l¸6¿<¹<ÈÔ.QØ—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,   )rG   ú
np.ndarrayre   úAxisInt | Nonerf   r[   )
rb   rI   ÚgetattrÚbnÚAttributeErrorÚ	NameErrorrU   rV   r   r   )r9   ru   rR   rv   rw   s   `` @@r*   rW   zbottleneck_switch.__call__g   s’   û€ Ø—)‘)Ò+˜sŸ|™|ˆð	Üœb 'Ó*ˆGô 
�‰˜Ó	ð $(Øñ	%	Øð%	ð !ð%	ð ÷	%	ó 
ð%	ôN ”A�q‹zÐøôW ¤	Ð*ò 	ØŠGð	ús    A* Á*A>Á=A>r&   )rX   rY   )ru   r   rX   r   )rI   r\   r]   r6   rW   © r,   r*   r`   r`   b   s   „ ôô0r,   r`   c                ó4   — | t         k7  rt        | «      s|dvS y)N)ÚnansumÚnanprodÚnanmeanF)Úobjectr   )r3   rb   s     r*   ro   ro   š   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Úndarrayr3   r   Úhas_infsÚravelÚisinfrH   rK   ÚNotImplementedError)rt   s    r*   rq   rq   ®   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 |dk(  rt        j
                  S t        S )z9return the correct fill value for the dtype of the valuesú+inf)Ú_na_ok_dtyper‰   rC   Úinfr   Úi8maxr
   )r3   Ú
fill_valueÚfill_value_typs      r*   Ú_get_fill_valuer–   »   sZ   € ð ÐØÐÜ�EÔØÐ!Ü—6‘6ˆMà Ò'Ü—v‘v�äŸ™�w�à˜VÒ#ä—9‘9ÐäˆKr,   c                ó†   — |€>| j                   j                  dv ry|s| j                   j                  dv rt        | «      }|S )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)r3   Úkindr   )rG   rf   ri   s      r*   Ú_maybe_get_maskr›   Ñ   sA   € ðB €|Ø�<‰<×Ñ Ñ%àá�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›   r3   rš   r‰   ÚasarrayÚviewr–   rH   r‘   ÚcopyÚputmaskÚwhere)rG   rf   r”   r•   ri   r3   Ú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ÚbiÚurR   )rš   r‰   r3   Úint64Úuint64Úfloat64)r3   Ú	dtype_maxs     r*   Ú_get_dtype_maxr¬   D  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   r=   r1   r‰   Úinteger©r3   s    r*   r‘   r‘   P  s%   € Ü˜5Ô!ØÜ˜%Ÿ*™*¤b§j¡jÓ1Ð1Ð1r,   c                óŠ  — | 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™| |k(  st	        j                  | «      r&t	        j                  d«      j                  |«      } | S t	        j                  | «      t        j                   kD  rt#        d«      ‚t	        j                  | «      j                  |d¬«      } | S | j                  d	«      j                  |«      } | S )
zwrap our results if neededÚMzExpected non-null fill_valuer   ÚnsF©r    Úmzoverflow in timedelta operationúm8[ns])r   rš   r
   rˆ   r‰   rŠ   r   rC   Ú
datetime64Úastyper¨   rŸ   ÚisnanÚtimedelta64Úfabsr   r“   rL   )rt   r3   r”   s      r*   Ú_wrap_resultsr»   V  s„  € à”�}ØðF €MðC 
�‰�sÒ	ØÐäˆJÜ˜&¤"§*¡*Ô-Ü˜JÔ'ÐGÐ)GÓGÐ'Ø˜Ò#ÜŸ™�ä�FŒ|ÜŸ™ u¨dÓ3×:Ñ:¸5ÓA‘äŸ™ &Ó)×.Ñ.¨uÓ5�à—]‘] 5¨u�]Ó5ˆFð& €Mð! —]‘] 5Ó)ˆFð  €Mð 
�‰�sÒ	Ü˜&¤"§*¡*Ô-Ø˜Ò#¤r§x¡x°Ô'7ÜŸ™¨Ó.×5Ñ5°eÓ<�ð €Mô —‘˜“¤3§9¡9Ò,ä Ð!BÓCÐCô Ÿ™ &Ó)×0Ñ0°¸UÐ0ÓC�ð
 €Mð —]‘] 8Ó,×1Ñ1°%Ó8ˆFà€Mr,   c                óx   ‡ — t        j                  ‰ «      ddddœ	 	 	 	 	 	 	 dˆ fd„«       }t        t        |«      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©re   rf   ri   c               óØ   •— | }| j                   j                  dv }|r|€t        | «      } ‰| f|||dœ|¤Ž}|r0t        ||j                   t        ¬«      }|s|€J ‚t        ||||«      }|S )Nr™   r½   )r”   )r3   rš   r   r»   r
   Ú_mask_datetimelike_result)	rG   re   rf   ri   rN   Úorig_valuesr£   rt   Úfuncs	           €r*   Únew_funcz&_datetimelike_compat.<locals>.new_func…  s�   ø€ ð ˆà—|‘|×(Ñ(¨DÐ0ˆÙ˜D˜LÜ˜“<ˆDá�fÐL 4°¸TÑLÀVÑLˆáÜ" 6¨;×+<Ñ+<ÌÔNˆFÙØÐ'Ð'Ð'Ü2°6¸4ÀÀ{ÓS�àˆr,   ©rG   rx   re   ry   rf   r[   ri   únpt.NDArray[np.bool_] | NonerT   )rÁ   rÂ   s   ` r*   Ú_datetimelike_compatrÅ     s`   ø€ ô ‡_�_�TÓð  $ØØ-1ñØðð ðð ð	ð
 +ôó ðô0 ”�8ÓÐ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¯   )r3   rš   r·   r    ÚndimÚshaper‰   Úfull)rG   re   r”   Úresult_shapes       r*   rn   rn   ¡  sŠ   € ð" ‡|�|×Ñ˜GÑ#Ø—‘˜yÓ)ˆÜ# F§L¡LÓ1€Jà‡{�{�aÒØÐØ	ˆØÐà—|‘| E TÐ*¨V¯\©\¸$À¹(¸*Ð-EÑEˆä�w‰w�| Z°v·|±|ÔDÐDr,   c                óf   ‡ — t        j                  ‰ «      ddœdˆ fd„«       }t        t        |«      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.
    N©re   c          	     ó  •— |dk(  rï| j                   dk(  rà| j                  d   rÑ| j                  d   dz  | j                  d   kD  r¯| j                  t        k7  rœ| j                  t
        k7  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   ri   re   )rÉ   ÚflagsrÊ   r3   rƒ   r[   Úlistrm   rp   Úrangerj   r‰   Úarray)	rG   re   rN   Úarrsri   ÚiÚresultsÚxrÁ   s	           €r*   Únewfuncz&maybe_operate_rowwise.<locals>.newfuncÇ  s  ø€ ð �AŠIØ—‘˜qÒ Ø—‘˜^Ò,ð —‘˜a‘ 4Ñ'¨6¯<©<¸©?Ò:Ø—‘¤Ò&Ø—‘¤Ò$ä˜“<ˆ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   Â0DÃD)rG   rx   re   ry   rT   )rÁ   rÚ   s   ` r*   Úmaybe_operate_rowwiserÛ   À  s2   ø€ ô ‡_�_�TÓØ>Bö 1ó ð1ô. ”�7ÓÐr,   r½   c               óh  — | j                   j                  dv r|€| j                  |«      S | j                   j                  dk(  r$t        j                  dt
        t        «       ¬«       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)
    True

    >>> from pandas.core import nanops
    >>> s = pd.Series([np.nan])
    >>> nanops.nanany(s.values)
    False
    Úiubr±   zz'any' with datetime64 dtypes is deprecated and will raise in a future version. Use (obj != pd.Timestamp(0)).any() instead.©Ú
stacklevelF©r”   ri   )r3   rš   rH   Úwarningsr#   ÚFutureWarningr   r¤   rƒ   r·   r[   ©rG   re   rf   ri   Ú_s        r*   Únananyrå   â  sœ   € ðD ‡|�|×Ñ˜EÑ! d lð �z‰z˜$ÓÐà‡|�|×Ñ˜CÒä�‰ðJäÜ'Ó)õ		
ô ˜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        j                  dt
        t        «       ¬«       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)
    True

    >>> from pandas.core import nanops
    >>> s = pd.Series([1, 0])
    >>> nanops.nanall(s.values)
    False
    rÝ   r±   zz'all' with datetime64 dtypes is deprecated and will raise in a future version. Use (obj != pd.Timestamp(0)).all() instead.rÞ   Trà   )r3   rš   Úallrá   r#   râ   r   r¤   rƒ   r·   r[   rã   s        r*   Únanallrè     sœ   € ðD ‡|�|×Ñ˜EÑ! d lð �z‰z˜$ÓÐà‡|�|×Ñ˜CÒä�‰ðJäÜ'Ó)õ		
ô ˜F F°tÀ$ÔG�I€FˆAð ‡|�|”vÒØ—‘œtÓ$ˆð �:‰:�dÓÐr,   ÚM8)re   rf   rh   ri   c               ó:  — | j                   }t        | |d|¬«      \  } }t        |«      }|j                  dk(  r|}n2|j                  dk(  r#t	        j                   t        j
                  «      }| j                  ||¬«      }t        |||| j                  |¬«      }|S )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)
    3.0
    r   rà   rR   r´   r¯   ©rh   )	r3   r¤   r¬   rš   r‰   rª   ÚsumÚ_maybe_null_outrÊ   )rG   re   rf   rh   ri   r3   Ú	dtype_sumÚthe_sums           r*   r€   r€   \  sˆ   € ðD �L‰L€EÜ˜v v¸!À$ÔG�L€FˆDÜ˜uÓ%€IØ‡z�z�SÒØ‰	Ø	�‰�sÒ	Ü—H‘HœRŸZ™ZÓ(ˆ	à�j‰j˜ YˆjÓ/€GÜ˜g t¨T°6·<±<È9ÔU€Gà€Nr,   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Ÿ   r3   rH   r
   r¨   )rt   re   ri   rÀ   Ú	axis_masks        r*   r¿   r¿   Œ  sƒ   € ô �&œ"Ÿ*™*Ô%à—‘˜tÓ$×)Ñ)¨+×*;Ñ*;Ó<ˆØ—H‘H $�HÓ'ˆ	ô !ˆˆyÑð €Mð �8‰8Œ:Ü—8‘8œD“>×&Ñ& {×'8Ñ'8Ó9Ð9Ø€Mr,   c               ó4  — | j                   }t        | |d|¬«      \  } }t        |«      }t        j                   t        j                  «      }|j
                  dv r$t        j                   t        j                  «      }nE|j
                  dv r$t        j                   t        j                  «      }n|j
                  dk(  r|}|}t        | j                  |||¬«      }| j                  ||¬«      }t        |«      }|�ut        |dd	«      rht        t        j                  |«      }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)
    1.5
    r   rà   r™   ÚiurR   r¯   NrÉ   FÚignore)rç   )r3   r¤   r¬   r‰   rª   rš   Ú_get_countsrÊ   rì   Ú_ensure_numericrz   r   rŠ   ÚerrstaterH   rC   )rG   re   rf   ri   r3   rî   Údtype_countÚcountrï   Úthe_meanÚct_masks              r*   r‚   r‚   Ÿ  sR  € ðB �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Ò	Øˆ	Øˆä˜Ÿ™ d¨D¸ÔD€EØ�j‰j˜ YˆjÓ/€GÜ˜gÓ&€GàÐœG G¨V°UÔ;Ü”R—Z‘Z Ó'ˆÜ�[‰[˜XÔ&ñ 	'à ‘ˆH÷	'ð ˜1‘*ˆØ�;‰;Œ=Ü "§¡ˆH�WÑð €Oð ',¨a¢i�7˜U’?´R·V±Vˆà€O÷	'ð 	'ús   Ä:FÆFc               ót  ‡— | j                   j                  dk(  xr |du }dˆfd„	}| j                   }t        | ‰|d¬«      \  } }| j                   j                  dk7  rM| j                   t        k(  r(t	        j
                  | «      }|dv rt        d| › d�«      ‚	 | 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(  r0|d	k(  r+t        j.                  t        j0                  | «      d¬«      }
nt        j.                  | |¬«      }
ddd«       n2t3        | j,                  |«      }
n|	r	 || |«      nt        j                  }
t5        
|«      S # t        $ r}t        t        |«      «      |‚d}~ww xY w# 1 sw Y   Œ;xY w)aØ  
    Parameters
    ----------
    values : ndarray
    axis : int, optional
    skipna : bool, default True
    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, 2])
    >>> nanops.nanmedian(s.values)
    2.0
    rR   Nc                ó(  •— |€t        | «      }n| }‰s |j                  «       st        j                  S t	        j
                  «       5  t	        j                  ddt        «       t        j                  | |   «      }d d d «       |S # 1 sw Y   S xY w)Nrô   úAll-NaN slice encountered)	r!   rç   r‰   rC   rá   Úcatch_warningsÚfilterwarningsÚRuntimeWarningÚ	nanmedian)rÙ   Ú_maskÚresrf   s      €r*   Ú
get_medianznanmedian.<locals>.get_medianý  s€   ø€ Øˆ=Ü˜!“H‰Eà�FˆEÙ˜eŸi™iœkÜ—6‘6ˆMÜ×$Ñ$Ó&ñ 	)ä×#Ñ#ØÐ5´~ôô —,‘,˜q ™xÓ(ˆC÷	)ð ˆ
÷	)ð ˆ
ús   Á	4BÂB)ri   r”   ©ÚstringÚmixedzCannot convert ú to numericr…   rÈ   rô   rþ   r   T)ÚkeepdimsrÎ   r&   )r3   rš   r¤   rƒ   r   Úinfer_dtyperK   r·   rL   ÚstrrÒ   Ú	writeabler    r‰   rC   rl   rÉ   Úapply_along_axisrá   rÿ   r   r  rÊ   r  ÚsqueezeÚ_get_empty_reduction_resultr»   )rG   re   rf   ri   Úusing_nan_sentinelr  r3   ÚinferredÚerrÚnotemptyr  s     `        r*   r  r  à  s÷  ø€ ð6  Ÿ™×*Ñ*¨cÑ1ÒB°d¸d°lÐõð �L‰L€EÜ˜v v°DÀTÔJ�L€FˆDØ‡|�|×Ñ˜CÒØ�<‰<œ6Ò!ä—‘ vÓ.ˆHØÐ.Ñ.Ü /°&°¸Ð EÓFÐFð	/Ø—]‘] 4Ó(ˆFñ  $Ð"2Ø�|‰|×%Ò%Ø—[‘[“]ˆFÜ—v‘vˆˆt‰à�{‰{€Hð ‡{�{�Q‚˜4Ð+áÙÜ×)Ñ)¨*°d¸FÓC‘ô ×,Ñ,Ó.ñ >ä×+Ñ+Ø Ð"=¼~ôð Ÿ™ Q™¨1Ò,°¸²ØŸ™ Q™¨1Ò,°¸²ô !Ÿl™l¬2¯:©:°fÓ+=ÈÔM™ä Ÿl™l¨6¸Ô=˜÷>ð >ô$ .¨f¯l©l¸DÓA‰Cñ +3‰j˜ Ô&¼¿¹ˆÜ˜˜eÓ$Ð$øôU ò 	/äœC ›HÓ%¨3Ð.ûð	/ú÷&>ð >ús%   ÂH Ä5BH.È	H+ÈH&È&H+È.H7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Õ   Úarangerj   Úemptyrª   ÚfillrC   )rÊ   re   ÚshpÚdimsÚrets        r*   r  r  C  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 t        j                  }t        j                  }||fS t        t        j                  |«      }||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 : int, np.nan or np.ndarray
    d : int, np.nan or np.ndarray
    r¯   )	rõ   r1   r   r‰   rC   r   rŠ   rH   r¡   )Úvalues_shaperi   re   Úddofr3   rù   Úds          r*   Ú_get_counts_nanvarr   Z  s«   € ô: ˜ d¨D¸Ô>€EØ�—
‘
˜4Ó Ñ €Aô �„Ø�DŠ=ô —F‘FˆEÜ—‘ˆAð �!ˆ8€Oô ”R—Z‘Z Ó'ˆØ˜‰}ˆØ�8‰8Œ:Ü�J‰J�q˜$¤§¡Ô'Ü�J‰J�u˜d¤B§F¡FÔ+Ø�!ˆ8€Or,   rÈ   ©r  ©re   rf   r  ri   c          	     óÚ   — | j                   dk(  r| j                  d«      } | 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
        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
    zM8[ns]rµ   )ri   r"  )r3   rŸ   r¤   r‰   ÚsqrtÚnanvarr»   )rG   re   rf   r  ri   Ú
orig_dtypert   s          r*   Únanstdr'  Œ  sb   € ðH ‡|�|�xÒØ—‘˜XÓ&ˆà—‘€JÜ˜v v°DÔ9�L€FˆDä�W‰W”V˜F¨°fÀ4ÈdÔSÓT€FÜ˜ Ó,Ð,r,   Úm8c               ó  — | j                   }t        | ||«      }|j                  dv r&| j                  d«      } |�t        j
                  | |<   | j                   j                  dk(  r't        | j                  |||| j                   «      \  }}nt        | j                  |||«      \  }}|r)|�'| j                  «       } t	        j                  | |d«       t        | j                  |t        j                  ¬«      «      |z  }|�t	        j                  ||«      }t        || z
  dz  «      }	|�t	        j                  |	|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
        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…   rR   r   )re   r3   rÐ   Fr³   )r3   r›   rš   r·   r‰   rC   r   rÊ   r    r¡   rö   rì   rª   Úexpand_dims)rG   re   rf   r  ri   r3   rù   r  ÚavgÚsqrrt   s              r*   r%  r%  º  sU  € ðJ �L‰L€EÜ˜6 6¨4Ó0€DØ‡z�z�TÑØ—‘˜tÓ$ˆØÐÜŸ6™6ˆF�4‰Là‡|�|×Ñ˜CÒÜ% f§l¡l°D¸$ÀÀfÇlÁlÓS‰ˆ‰qä% f§l¡l°D¸$ÀÓE‰ˆˆqá�$Ð"Ø—‘“ˆÜ
�
‰
�6˜4 Ô#ô ˜&Ÿ*™*¨$´b·j±j˜*ÓAÓ
BÀUÑ
J€CØÐÜ�n‰n˜S $Ó'ˆÜ
˜3 ™<¨AÑ-Ó
.€CØÐÜ
�
‰
�3˜˜aÔ Ø�W‰W˜$¤b§j¡jˆWÓ1°AÑ5€Fð
 ‡z�z�SÒØ—‘˜u¨5�Ó1ˆØ€Mr,   c               óš  — t        | ||||¬«       t        | ||«      }| j                  j                  dk7  r| j	                  d«      } |s"|� |j                  «       rt        j                  S t        | j                  |||| 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
        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)
     0.5773502691896258
    r"  rR   r…   )r%  r›   r3   rš   r·   rH   r‰   rC   r   rÊ   r$  )rG   re   rf   r  ri   rù   rä   Úvars           r*   Únansemr/    s§   € ôL ˆ6˜ V°$¸TÕBä˜6 6¨4Ó0€DØ‡|�|×Ñ˜CÒØ—‘˜tÓ$ˆá�dÐ&¨4¯8©8¬:Ü�v‰vˆä! &§,¡,°°d¸DÀ&Ç,Á,ÓO�H€Eˆ1Ü
�˜d¨6¸À4Ô
H€Cä�7‰7�3‹<œ"Ÿ'™' %›.Ñ(Ð(r,   c                óf   ‡ ‡— t        d‰ › �¬«      t        d dd dœ	 	 	 	 	 	 	 dˆˆ fd„«       «       }|S )NrC   )rb   Tr½   c               ó¶   •— | j                   dk(  rt        | |«      S t        | |‰|¬«      \  } } t        | ‰«      |«      }t	        |||| j
                  «      }|S )Nr   ©r•   ri   )rl   rn   r¤   rz   rí   rÊ   )rG   re   rf   ri   rt   r•   Úmeths        €€r*   Ú	reductionz_nanminmax.<locals>.reduction;  sc   ø€ ð �;‰;˜!ÒÜ$ V¨TÓ2Ð2ä"Ø�F¨>Àô
‰ˆ�ð '”˜ Ó& tÓ,ˆÜ  ¨¨t°V·\±\ÓBˆØˆr,   rÃ   )r`   rÅ   )r3  r•   r4  s   `` r*   Ú
_nanminmaxr5  :  sa   ù€ Ü˜c $ ˜LÔ)Üð  $ØØ-1ñØðð ðð ð	ð
 +õó ó *ðð" Ðr,   Úminr�   )r•   Úmaxú-infc               óh   — t        | dd|¬«      \  } }| j                  |«      }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)
    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])
    Tr8  r2  )r¤   ÚargmaxÚ_maybe_arg_null_out©rG   re   rf   ri   rt   s        r*   Ú	nanargmaxr=  U  ó>   € ôL ˜v t¸FÈÔN�L€FˆDØ�]‰]˜4Ó €Fô ! ¨¨t°VÓ<€FØ€Mr,   c               óh   — t        | dd|¬«      \  } }| j                  |«      }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)
    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�   r2  )r¤   Úargminr;  r<  s        r*   Ú	nanargminrA  ƒ  r>  r,   c               ó:  — t        | ||«      }| j                  j                  dk7  r)| j                  d«      } t	        | j
                  ||«      }n#t	        | j
                  ||| j                  ¬«      }|r*|�(| j                  «       } t        j                  | |d«       n$|s"|� |j                  «       rt        j                  S t        j                  dd¬«      5  | j                  |t        j                  ¬«      |z  }ddd«       |�t        j                  |«      }| z
  }|r|�t        j                  ||d«       |dz  }||z  }|j                  |t        j                  ¬«      }	|j                  |t        j                  ¬«      }
t        |	«      }	t        |
«      }
t        j                  dd¬«      5  ||d	z
  d
z  z  |dz
  z  |
|	dz  z  z  }ddd«       | j                  }|j                  dk(  rj                  |d¬«      }t!        t        j"                  «      r2t        j$                  |	dk(  d|«      }t        j                  ||dk  <   |S |	dk(  r|j'                  d«      n|}|dk  rt        j                  S |S # 1 sw Y   �Œ‡xY w# 1 sw Y   Œ¿xY w)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)
    1.7320508075688787
    rR   r…   r¯   Nr   rô   ©ÚinvalidÚdividerÐ   rÈ   g      à?g      ø?Fr³   é   )r›   r3   rš   r·   rõ   rÊ   r    r‰   r¡   rH   rC   r÷   rì   rª   r*  Ú_zero_out_fperrrˆ   rŠ   r¢   r1   )rG   re   rf   ri   rù   ÚmeanÚadjustedÚ	adjusted2Ú	adjusted3Úm2Úm3rt   r3   s                r*   ÚnanskewrN  ±  sF  € ôJ ˜6 6¨4Ó0€DØ‡|�|×Ñ˜CÒØ—‘˜tÓ$ˆÜ˜FŸL™L¨$°Ó5‰ä˜FŸL™L¨$°¸F¿L¹LÔIˆá�$Ð"Ø—‘“ˆÜ
�
‰
�6˜4 Õ#Ù˜Ð(¨T¯X©X¬ZÜ�v‰vˆä	�‰˜X¨hÔ	7ñ :Ø�z‰z˜$¤b§j¡jˆzÓ1°EÑ9ˆ÷:àÐÜ�~‰~˜d DÓ)ˆà˜‰}€HÙ�$Ð"Ü
�
‰
�8˜T 1Ô%Ø˜!‘€IØ˜HÑ$€IØ	�‰�t¤2§:¡:ˆÓ	.€BØ	�‰�t¤2§:¡:ˆÓ	.€Bô 
˜Ó	€BÜ	˜Ó	€Bä	�‰˜X¨hÔ	7ñ MØ˜5 1™9¨Ñ,Ñ,°¸±	Ñ:¸rÀBÈÁG¹|ÑLˆ÷Mð �L‰L€EØ‡z�z�SÒØ—‘˜u¨5�Ó1ˆä�&œ"Ÿ*™*Ô%Ü—‘˜" ™' 1 fÓ-ˆÜŸF™Fˆˆu�q‰yÑð €Mð	 #%¨¢'�—‘˜A”¨vˆØ�1Š9Ü—6‘6ˆMà€M÷G:ñ :ú÷(Mð Mús   Ã%JÆ8JÊJÊJc               ó"  — t        | ||«      }| j                  j                  dk7  r)| j                  d«      } t	        | j
                  ||«      }n#t	        | j
                  ||| j                  ¬«      }|r*|�(| j                  «       } t        j                  | |d«       n$|s"|� |j                  «       rt        j                  S t        j                  dd¬«      5  | j                  |t        j                  ¬«      |z  }ddd«       |�t        j                  |«      }| z
  }|r|�t        j                  ||d«       |dz  }|dz  }|j                  |t        j                  ¬«      }	|j                  |t        j                  ¬«      }
t        j                  dd¬«      5  d	|d
z
  dz  z  |dz
  |d	z
  z  z  }||d
z   z  |d
z
  z  |
z  }|dz
  |d	z
  z  |	dz  z  }ddd«       t        «      }t        «      }t!        |t        j"                  «      s5|dk  rt        j                  S |dk(  r| j                  j%                  d«      S t        j                  dd¬«      5  ||z  z
  }ddd«       | j                  }|j                  dk(  rj                  |d¬«      }t!        t        j"                  «      r0t        j&                  |dk(  d|«      }t        j                  ||dk  <   |S # 1 sw Y   �ŒîxY w# 1 sw Y   �ŒxY w# 1 sw Y   Œ�xY w)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])
    >>> nanops.nankurt(s.values)
    -1.2892561983471076
    rR   r…   r¯   Nr   rô   rC  rÐ   rF  rÈ   é   Fr³   )r›   r3   rš   r·   rõ   rÊ   r    r‰   r¡   rH   rC   r÷   rì   rª   r*  rG  rˆ   rŠ   r1   r¢   )rG   re   rf   ri   rù   rH  rI  rJ  Ú	adjusted4rL  Úm4ÚadjÚ	numeratorÚdenominatorrt   r3   s                   r*   ÚnankurtrV  	  s¶  € ôJ ˜6 6¨4Ó0€DØ‡|�|×Ñ˜CÒØ—‘˜tÓ$ˆÜ˜FŸL™L¨$°Ó5‰ä˜FŸL™L¨$°¸F¿L¹LÔIˆá�$Ð"Ø—‘“ˆÜ
�
‰
�6˜4 Õ#Ù˜Ð(¨T¯X©X¬ZÜ�v‰vˆä	�‰˜X¨hÔ	7ñ :Ø�z‰z˜$¤b§j¡jˆzÓ1°EÑ9ˆ÷:àÐÜ�~‰~˜d DÓ)ˆà˜‰}€HÙ�$Ð"Ü
�
‰
�8˜T 1Ô%Ø˜!‘€IØ˜1‘€IØ	�‰�t¤2§:¡:ˆÓ	.€BØ	�‰�t¤2§:¡:ˆÓ	.€Bä	�‰˜X¨hÔ	7ñ 8Ø�5˜1‘9 Ñ"Ñ" u¨q¡y°U¸Q±YÑ&?Ñ@ˆØ˜U Q™YÑ'¨5°1©9Ñ5¸Ñ:ˆ	Ø˜q‘y U¨Q¡YÑ/°"°a±%Ñ7ˆ÷8ô   	Ó*€IÜ! +Ó.€Kä�k¤2§:¡:Ô.ð �1Š9Ü—6‘6ˆMØ˜!ÒØ—<‘<×$Ñ$ QÓ'Ð'ä	�‰˜X¨hÔ	7ñ /Ø˜[Ñ(¨3Ñ.ˆ÷/ð �L‰L€EØ‡z�z�SÒØ—‘˜u¨5�Ó1ˆä�&œ"Ÿ*™*Ô%Ü—‘˜+¨Ñ*¨A¨vÓ6ˆÜŸF™Fˆˆu�q‰yÑà€M÷Y:ñ :ú÷8ñ 8ú÷(/ð /ús$   Ã%K+Æ":K8É 	LË+K5Ë8LÌLc               ó¤   — t        | ||«      }|r|�| j                  «       } d| |<   | j                  |«      }t        |||| j                  |¬«      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)
    6.0
    rÈ   rë   )r›   r    Úprodrí   rÊ   )rG   re   rf   rh   ri   rt   s         r*   r�   r�   j  s[   € ô@ ˜6 6¨4Ó0€Dá�$Ð"Ø—‘“ˆØˆˆt‰Ø�[‰[˜Ó€Fô Ø��d˜FŸL™L°Iôð r,   c                óì   — |€| S |�t        | dd«      s&|r|j                  «       ry|j                  «       ry| S |r|j                  |«      }n|j                  |«      }|j                  «       rd| |<   | S )NrÉ   Féÿÿÿÿ)rz   rç   rH   )rt   re   ri   rf   Úna_masks        r*   r;  r;  —  sv   € ð €|Øˆà€|œ7 6¨6°5Ô9ÙØ�x‰xŒzØà�x‰xŒzØð €Mñ Ø—h‘h˜t“n‰Gà—h‘h˜t“nˆGØ�;‰;Œ=Ø ˆF�7‰OØ€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³   )rl   rì   r‰   rX  r1   rÊ   r   r·   )r  ri   re   r3   Únrù   s         r*   rõ   rõ   ²  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                  |«      rjt        | «      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)
    Nr   rÈ   Úc16r…   Fr³   r3   rC   )rˆ   r‰   rŠ   rÊ   rì   Úbroadcast_torH   r   Úiscomplexobjr·   r   rC   r   Úcheck_below_min_countrz   r1   )	rt   re   ri   rÊ   rh   Ú	null_maskÚbelow_countÚ	new_shapeÚresult_dtypes	            r*   rí   rí   Û  sU  € ð €|˜	 QšàˆàÐœ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�)ÔÜ Ô'Ü—?‘? 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‰   rX  rl   rì   )rÊ   ri   rh   Ú	non_nullss       r*   rb  rb    s?   € ð( �1‚}Øˆ<äŸ™ ›‰IàŸ	™	 D§H¡H£JÑ.ˆIØ�yÒ ØØr,   c                óú   — t        | t        j                  «      r-t        j                  t        j                  | «      dk  d| «      S t        j                  | «      dk  r| j
                  j                  d«      S | S )Ng›+¡†›„=r   )rˆ   r‰   rŠ   r¢   Úabsr3   r1   )Úargs    r*   rG  rG  *  sW   € ä�#”r—z‘zÔ"Ü�x‰xœŸ™˜s› eÑ+¨Q°Ó4Ð4ä$&§F¡F¨3£K°%Ò$7ˆs�y‰y�~‰~˜aÓ Ð@¸SÐ@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È   )rj   ÚAssertionErrorr!   rç   r‰   rC   rö   Úget_corr_func)ÚaÚbrm  rn  ÚvalidrR   s         r*   Únancorrru  2  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~   )rr  rs  rx  s     €r*   rÁ   zget_corr_func.<locals>.funcX  s   ø€ Ù˜a Ó# AÑ&Ð&r,   Úspearman)Ú	spearmanrc                ó   •—  ‰| |«      d   S rz  r~   )rr  rs  r|  s     €r*   rÁ   zget_corr_func.<locals>.func_  s   ø€ Ù˜Q “? 1Ñ%Ð%r,   rl  c                ó4   — t        j                  | |«      d   S )N©r   rÈ   )r‰   Úcorrcoef)rr  rs  s     r*   rÁ   zget_corr_func.<locals>.funce  s   € Ü—;‘;˜q !Ó$ TÑ*Ð*r,   zUnknown method 'z@', expected one of 'kendall', 'spearman', 'pearson', or callable)Úscipy.statsrx  r|  ÚcallablerL   )rm  rÁ   rx  r|  s     @@r*   rq  rq  R  sr   ù€ ð �ÒÝ*ô	'ð ˆØ	�:Ò	Ý)ô	&ð ˆØ	�9Ò	ò	+ð ˆÜ	�&Ô	Øˆä
Ø
˜6˜(ð #8ð 	8óð r,   )rn  r  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È   r!  r  )rj   rp  r!   rç   r‰   rC   rö   Úcov)rr  rs  rn  r  rt  s        r*   Únancovr…  r  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        | t        j                  «      rÌ| j                  j                  dv r!| j                  t        j                  «      } | S | j                  t        k(  r~t        j                  | «      }|dv rt        d| › d�«      ‚	 | j                  t        j                  «      } t        j                  t        j                  | «      «      s| j                  } | S | S t!        | «      sCt#        | «      s8t%        | «      s-t        | t&        «      rt        d| › d�«      ‚	 t)        | «      } | S | S # t        t        f$ rF 	 | j                  t        j                  «      } n!# t        $ r}t        d| › d�«      |‚d }~ww xY wY | S w xY w# t        t        f$ r1 	 t+        | «      } Y | S # t        $ r}t        d| › d�«      |‚d }~ww xY ww xY w)Nr˜   r  zCould not convert r	  zCould not convert string 'z' to numeric)rˆ   r‰   rŠ   r3   rš   r·   rª   rƒ   r   r  rK   Ú
complex128rH   ÚimagÚrealrL   r   r   r   r  ÚfloatÚcomplex)rÙ   r  r  s      r*   rö   rö   Ž  s¿  € Ü�!”R—Z‘ZÔ Ø�7‰7�<‰<˜5Ñ Ø—‘œŸ™Ó$ˆAð< €Hð; �W‰WœÒÜ—‘ qÓ)ˆHØÐ.Ñ.äÐ"4°Q°C°{Ð CÓDÐDð
Ø—H‘HœRŸ]™]Ó+�ô —v‘vœbŸg™g a›jÔ)ØŸ™�Að €Hˆ1€Hô �qŒkœZ¨œ]¬j¸¬mÜ�aœÔäÐ8¸¸¸<ÐHÓIÐIð	NÜ�a“ˆAð €Hˆ1€Høô- œzÐ*ò RðRØŸ™¤§¡Ó,‘AøÜ!ò Rä#Ð&8¸¸¸;Ð$GÓHÈcÐQûðRúð ð( €Hð-Rûô œ:Ð&ò 	NðNÜ˜A“J‘ð €Høô ò NäÐ"4°Q°C°{Ð CÓDÈ#ÐMûðNúð		Nús`   ÂD7 Ä(F Ä7FÅE'Å&FÅ'	FÅ0F Æ FÆFÆFÆGÆF-Æ-	GÆ6GÇGÇG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
    g      ð?g        r™   r   rÎ   )r‰   ÚcumprodrC   ÚmaximumÚ
accumulater’   ÚcumsumÚminimumr3   rš   r=   r1   r®   Úbool_r    r   )rG   Ú
accum_funcrf   Úmask_aÚmask_bÚvalsri   rt   s           r*   Úna_accum_funcr—  ²  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[   rX   rY   )r3   r   rb   r  rX   r[   rZ   )NN)r3   r   r”   zScalar | None)rG   rx   rf   r[   ri   rÄ   rX   rÄ   )NNN)rG   rx   rf   r[   r”   r   r•   z
str | Noneri   rÄ   rX   z/tuple[np.ndarray, npt.NDArray[np.bool_] | None])r3   únp.dtyperX   r˜  )r3   r   rX   r[   r&   )r3   r˜  )rÁ   r   rX   r   )rG   rx   re   ry   rX   zScalar | np.ndarray)
rG   rx   re   ry   rf   r[   ri   rÄ   rX   r[   )rG   rx   re   ry   rf   r[   rh   Úintri   rÄ   rX   rŠ  )
rt   z+np.ndarray | np.datetime64 | np.timedelta64re   ry   ri   znpt.NDArray[np.bool_]rÀ   rx   rX   z5np.ndarray | np.datetime64 | np.timedelta64 | NaTType)
rG   rx   re   ry   rf   r[   ri   rÄ   rX   rŠ  )re   ry   rf   r[   )rÊ   r   re   r   rX   rx   )r  r   ri   rÄ   re   ry   r  r™  r3   r˜  rX   z-tuple[float | np.ndarray, float | np.ndarray])re   ry   rf   r[   r  r™  )rG   rx   re   ry   rf   r[   r  r™  )rG   rx   re   ry   rf   r[   r  r™  ri   rÄ   rX   rŠ  )
rG   rx   re   ry   rf   r[   ri   rÄ   rX   zint | np.ndarray)
rt   rx   re   ry   ri   rÄ   rf   r[   rX   znp.ndarray | int)
r  r   ri   rÄ   re   ry   r3   znp.dtype[np.floating]rX   z&np.floating | npt.NDArray[np.floating])rÈ   )rt   únp.ndarray | float | NaTTypere   ry   ri   rÄ   rÊ   útuple[int, ...]rh   r™  rX   rš  )rÊ   r›  ri   rÄ   rh   r™  rX   r[   )
rr  rx   rs  rx   rm  r   rn  ú
int | NonerX   rŠ  )rm  r   rX   z)Callable[[np.ndarray, np.ndarray], float])
rr  rx   rs  rx   rn  rœ  r  rœ  rX   rŠ  )rG   r   rf   r[   rX   r   )]Ú
__future__r   rU   rE   Útypingr   r   r   rá   Únumpyr‰   Úpandas._configr   Úpandas._libsr   r	   r
   r   Úpandas._typingr   r   r   r   r   r   r   r   r   Úpandas.compat._optionalr   Úpandas.util._exceptionsr   Úpandas.core.dtypes.commonr   r   r   r   r   r   r   r   Úpandas.core.dtypes.missingr   r    r!   r{   r'   r(   r+   r.   r`   ro   rq   r–   r›   r¤   r¬   r‘   r»   rÅ   rn   rÛ   rå   rè   r€   r¿   r‚   r  r  r3   rª   r   r'  r%  r/  r5  ÚnanminÚnanmaxr=  rA  rN  rV  r�   r;  rõ   rí   rb  rG  ru  rq  r…  rö   r—  r~   r,   r*   ú<module>r©     s  ðÝ "ã Û ÷ñ ó
 ã å %÷ó ÷
÷ 
õ 
õ ?Ý 4÷	÷ 	ó 	÷ñ ñ   °VÔ<€Ø $˜Ð Ø€ôñ ‘:Ð6Ó7Ô 8÷ñ ÷>5ñ 5ópó(
ð GKðØðØ!.óð,)Øð)Ø $ð)Ø,Hð)à!ó)ð^ Ø!%Ø)-ðDØðDàðDð ðDð ð	Dð
 'ðDð 5óDóN	ó2ô&óRóDEó>ðJ  ØØ)-ñ:Øð:ð ð:ð ð	:ð
 'ð:ð 
ó:ð@  ØØ)-ñ:Øð:ð ð:ð ð	:ð
 'ð:ð 
ó:ñz 
ˆ$ƒØØð  ØØØ)-ñ*Øð*ð ð*ð ð	*ð
 ð*ð 'ð*ð ò*ó ó ó ð*ðZØ7ðà
ðð  ðð ð	ð
 ;óñ& ÓØð  ØØ)-ñ<Øð<ð ð<ð ð	<ð
 'ð<ð ò<ó ó ð<ñ~ ÓØ04ÀTÐPTô _%ó ð_%ðDØðà
ðð óð8 �b—h‘h˜rŸz™zÓ*ð/Øð/à
&ð/ð ð/ð ð	/ð
 ð/ð 3ó/ñd ˜Ôð  ØØØ	ñ*-ð ð*-ð ð	*-ð
 ò*-ó ð*-ñZ 
ˆ$�ÓÙ˜Ôð  ØØØ	ñFØðFð ðFð ð	Fð
 òFó ó ðFñR 
ˆ$�Óð  ØØØ)-ñ1)Øð1)ð ð1)ð ð	1)ð
 ð1)ð 'ð1)ð ò1)ó ð1)òhñ. 
�E¨&Ô	1€Ù	�E¨&Ô	1€ð  ØØ)-ñ+Øð+ð ð+ð ð	+ð
 'ð+ð ó+ðb  ØØ)-ñ+Øð+ð ð+ð ð	+ð
 'ð+ð ó+ñ\ 
ˆ$�ÓØð  ØØ)-ñSØðSð ðSð ð	Sð
 'ðSð òSó ó ðSñl 
ˆ$�ÓØð  ØØ)-ñ\Øð\ð ð\ð ð	\ð
 'ð\ð ò\ó ó ð\ñ~ 
ˆ$�ÓØð  ØØØ)-ñ(Øð(ð ð(ð ð	(ð
 ð(ð 'ð(ð ò(ó ó ð(ðVØðà
ðð 'ðð ð	ð
 óð> $, 2§8¡8¨B¯J©JÓ#7ð	&+Øð&+à
&ð&+ð ð&+ð !ð	&+ð
 ,ó&+ð\ ð-Ø(ð-à
ð-ð 'ð-ð ð	-ð
 ð-ð "ó-ð`ØðØ">ðØKNðà	óò>Añ 
ˆ$�Óð
 !*Ø"ñØðàðð ð	ð
 ðð òó ðð>Øðà.óñ@ 
ˆ$�Óð
 #Øñ)Øð)àð)ð ð	)ð
 ð)ð ò)ó ð)ò6!ôH"r,   