ó
    Ñ]j´„  ã                  óŽ  • % S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
  SSKrSSKJr  SSKJrJrJr  SSKJrJrJrJrJr  SS	KJr  SS
KJr  SSKJrJrJ r J!r!J"r"  SSK#J$r$J%r%J&r&  SSK'J(r(J)r)J*r*  \(       a  SSK+J,r,  SSKJ-r-  SSK.J/r/  \S   r0S\1S'   S8S jr2S9S jr3\
SS.     S:S jj5       r4\
      S;S j5       r4SS.     S<S jjr4/ SQr5/ SQr6S=S jr7S>S jr8    S?S  jr9S@S! jr:      SAS" jr;SBS# jr<      SC                 SDS$ jjr=SES% jr>        SF                   SGS& jjr?   SH         SIS' jjr@   SJ         SKS( jjrA  SL         SMS) jjrB   SN             SOS* jjrC    SP           SQS+ jjrD SR   SSS, jjrESTS- jrF\F   SU         SVS. jj5       rG\F   SU         SVS/ jj5       rH\F   SU         SVS0 jj5       rI\F   SU     SWS1 jj5       rJ      SXS2 jrK      SXS3 jrL\G\HS4.rMSYSZS5 jjrNS[S6 jrO        S\S7 jrPg)]z$
Routines for filling missing data.
é    )Úannotations)Úwraps)ÚTYPE_CHECKINGÚAnyÚLiteralÚcastÚoverloadN)Ú	is_nan_na)ÚNaTÚalgosÚlib)Ú	ArrayLikeÚAxisIntÚFÚReindexMethodÚnpt)Úimport_optional_dependency)Úinfer_dtype_from)Úis_array_likeÚis_bool_dtypeÚis_numeric_dtypeÚis_object_dtypeÚneeds_i8_conversion)Ú
ArrowDtypeÚBaseMaskedDtypeÚDatetimeTZDtype)Úis_valid_na_for_dtypeÚisnaÚna_value_for_dtype)ÚCallable)Ú	TypeAlias)ÚIndex)ú
not-a-knotÚclampedÚnaturalÚperiodicr!   Ú_CubicBCc                ó€   • [        U 5      (       a-  [        U 5      U:w  a  [        S[        U 5       SU 35      eX   n U $ )zB
Validate the size of the values passed to ExtensionArray.fillna.
z'Length of 'value' does not match. Got (z)  expected )r   ÚlenÚ
ValueError)ÚvalueÚmaskÚlengths      ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pandas/core/missing.pyÚcheck_value_sizer/   >   sQ   € ô �U×ÑÜˆu‹:˜ÓÜØ9¼#¸e»*¸ð FØ#˜Hð&óð ð ‘ˆà€Ló    c                ó¸  • [        U5      u  p![        U R                  [        [        45      (       Ga2  [
        R                  " U5      (       Ga  [        R                  " U5      (       aû  [        5       (       dì  U R                  R                  S:X  a“  [        U R                  [        5      (       a4  [        R                  " U R                  5      U R                  5       ) -  nU$ SSKJn  UR                  U R                   5      R#                  S5      R%                  5       nU$ U R                  R                  S;   a%  [        R&                  " U R(                  [*        S9nU$ [        U5      (       a  [        U 5      $ [        R&                  " U R(                  [*        S9n[-        U R                  5      (       a8  [/        U R                  5      (       d  [
        R0                  " U5      (       a   U$ [/        U R                  5      (       a.  [-        U5      (       a  [
        R0                  " U5      (       d   U$ [-        U R                  5      (       a  [        U[2        5      (       a   U$ [5        U R                  5      (       a  [        U 5      ) nX   U:H  X5'   U$ X:H  n[        U[        R6                  5      (       d  UR%                  [*        SS9nUnU$ )a  
Return a masking array of same size/shape as arr
with entries equaling value set to True.

Parameters
----------
arr : ArrayLike
value : scalar-like
    Caller has ensured `not is_list_like(value)` and that it can be held
    by `arr`.

Returns
-------
np.ndarray[bool]
Úfr   NFÚiu©Údtype)r5   Úna_value)r   Ú
isinstancer5   r   r   r   Úis_floatÚnpÚisnanr
   ÚkindÚ_datar   Úpyarrow.computeÚcomputeÚis_nanÚ	_pa_arrayÚ	fill_nullÚto_numpyÚzerosÚshapeÚboolr   r   Úis_boolÚstrr   Úndarray)Úarrr+   r5   r,   ÚpcÚarr_maskÚnew_masks          r.   Úmask_missingrM   M   s  € ô  $ EÓ*�L€Eô 	�3—9‘9œ´
Ð;×<Ò<Ü�LŠL˜×ÒÜ�HŠH�U�O‰OÜ—‘ð �9‰9�>‰>˜SÓ ä˜#Ÿ)™)¤_×5Ñ5ä—x’x §	¡	Ó*¨c¯h©h«j¨[Ñ8�Ø�õ -à—y‘y §¡Ó/×9Ñ9¸%Ó@×IÑIÓK�Ø�à�Y‰Y�^‰^˜tÓ#ä—8’8˜CŸI™I¬TÑ2ˆDØˆKäˆE‡{�{Ü�C‹yÐô �8Š8�C—I‘I¤TÑ*€Dä˜Ÿ™×#Ñ#Ü˜cŸi™i×(Ñ(Ü�KŠK˜×Ñð 	ð, €Kô) 	�c—i‘i× Ñ Ô%5°e×%<Ñ%<ÄSÇ[Â[ÐQV×EWÑEWð 	ð" €Kô! 
˜#Ÿ)™)×	$Ñ	$¬°E¼3×)?Ñ)?àð €Kô 
˜Ÿ™×	#Ñ	#ô ˜“I�:ˆØ™¨%Ñ/ˆ‰ð €Kð ‘<ˆä˜(¤B§J¡J×/Ñ/à×(Ñ(¬t¸eÐ(ÐDˆHØˆà€Kr0   .©Úallow_nearestc               ó   • g ©N© ©ÚmethodrO   s     r.   Úclean_fill_methodrU   œ   s   € ð
 "%r0   c               ó   • g rQ   rR   rS   s     r.   rU   rU   ¤   s   € ð
 -0r0   Fc               óÞ   • [        U [        5      (       a!  U R                  5       n U S:X  a  Sn OU S:X  a  Sn SS/nSnU(       a  UR                  S5        SnX;  a  [	        SU S	U  35      eU $ )
NÚffillÚpadÚbfillÚbackfillzpad (ffill) or backfill (bfill)Únearestz(pad (ffill), backfill (bfill) or nearestzInvalid fill method. Expecting z. Got )r7   rG   ÚlowerÚappendr*   )rT   rO   Úvalid_methodsÚ	expectings       r.   rU   rU   ¬   s�   € ô
 �&œ#×Ñð —‘“ˆØ�WÓØ‰FØ�wÓØˆFà˜JÐ'€MØ1€IÞØ×Ñ˜YÔ'Ø>ˆ	ØÓ"ÜÐ:¸9¸+ÀVÈFÈ8ÐTÓUÐUØ€Mr0   )ÚlinearÚtimeÚindexÚvalues)r\   ÚzeroÚslinearÚ	quadraticÚcubicÚbarycentricÚkroghÚsplineÚ
polynomialÚfrom_derivativesÚpiecewise_polynomialÚpchipÚakimaÚcubicsplinec                óâ   • UR                  S5      nU S;   a  Uc  [        S5      e[        [        -   nX;  a  [        SU SU  S35      eU S;   a  UR                  (       d  [        U  S35      eU $ )	NÚorder)rk   rl   z7You must specify the order of the spline or polynomial.zmethod must be one of z. Got 'z
' instead.)rj   rn   ro   z4 interpolation requires that the index be monotonic.)Úgetr*   Ú
NP_METHODSÚ
SP_METHODSÚis_monotonic_increasing)rT   rc   Úkwargsrs   Úvalids        r.   Úclean_interp_methodrz   Ü   s…   € Ø�J‰J�wÓ€EàÐ)Ó)¨e©mÜÐRÓSÐSäœÑ#€EØÓÜÐ1°%°¸À¸xÀzÐRÓSÐSàÐ;Ó;Ø×,×,ÜØ�(ÐNÐOóð ð €Mr0   c                ó  • U S;   d   e[        U5      S:X  a  gUR                  S:X  a  UR                  SS9nU S:X  a  USS R                  5       nO+U S:X  a%  [        U5      S-
  USSS	2   R                  5       -
  nUW   nU(       d  gU$ )
zÿ
Retrieves the positional index of the first valid value.

Parameters
----------
how : {'first', 'last'}
    Use this parameter to change between the first or last valid index.
is_valid: np.ndarray
    Mask to find na_values.

Returns
-------
int or None
)ÚfirstÚlastr   Né   é   ©Úaxisr|   r}   éÿÿÿÿ)r)   ÚndimÚanyÚargmax)ÚhowÚis_validÚidxposÚ	chk_notnas       r.   Úfind_valid_indexrŠ   ï   s™   € ð Ð#Ó#Ð#Ð#ä
ˆ8ƒ}˜ÓØà‡}�}˜Óà—<‘< Q�<Ð'ˆà
ˆgƒ~Ø™"�×$Ñ$Ó&‰à	�‹Ü�X“ Ñ" X©d°¨d¡^×%:Ñ%:Ó%<Ñ<ˆà˜Ñ €IæØð €Mr0   c                ó\   • / SQnU R                  5       n X;  a  [        SU SU  S35      eU $ )N)ÚforwardÚbackwardÚbothz*Invalid limit_direction: expecting one of z, got 'z'.©r]   r*   )Úlimit_directionÚvalid_limit_directionss     r.   Úvalidate_limit_directionr’     sK   € ò =ÐØ%×+Ñ+Ó-€OØÓ4ÜØ8Ø%Ð& g¨oÐ->¸bðBó
ð 	
ð Ðr0   c                ób   • U b+  SS/nU R                  5       n X;  a  [        SU SU  S35      eU $ )NÚinsideÚoutsidez%Invalid limit_area: expecting one of z, got Ú.r�   )Ú
limit_areaÚvalid_limit_areass     r.   Úvalidate_limit_arear™   %  sS   € ØÑØ% yÐ1ÐØ×%Ñ%Ó'ˆ
ØÓ.ÜØ7Ð8IÐ7JÈ&Ø�,˜að!óð ð Ðr0   c                ó–   • U c  US;   a  Sn U $ Sn  U $ US;   a  U S:w  a  [        SU S35      eUS;   a  U S:w  a  [        SU S35      eU $ )N)r[   rZ   r�   rŒ   )rY   rX   z0`limit_direction` must be 'forward' for method `Ú`z1`limit_direction` must be 'backward' for method `)r*   )r�   rT   s     r.   Úinfer_limit_directionrœ   3  s�   € ð ÑØÐ*Ó*Ø(ˆOð Ðð (‰Oð Ðð Ð%Ó%¨/¸YÓ*FÜØBÀ6À(È!ÐLóð ð Ð*Ó*¨À*Ó/LÜØCÀFÀ8È1ÐMóð ð Ðr0   c                óÒ  • U S:X  a  SSK Jn  U" [        U5      5      nOŸ1 Skn[        UR                  5      =(       dB    [        UR                  [        5      =(       d!    [        R                  " UR                  S5      n[        [        -   nX;   a  X;  a  U(       d  [        SU  S35      eO[        SU  S	35      e[        U5      R                  5       (       a  [        S
5      eU$ )Nra   r   )Ú
RangeIndex>   rb   rc   rd   r\   ÚmMz9Index column must be numeric or datetime type when using z_ method other than linear. Try setting a numeric or datetime index column before interpolating.ú Can not interpolate with method=r–   zkInterpolation with NaNs in the index has not been implemented. Try filling those NaNs before interpolating.)Úpandasrž   r)   r   r5   r7   r   r   Úis_np_dtyperu   rv   r*   r   r„   ÚNotImplementedError)rT   rc   rž   ÚmethodsÚis_numeric_or_datetimery   s         r.   Úget_interp_indexr¦   H  sØ   € à�Óå%áœ3˜u›:Ó&‰â8ˆä˜UŸ[™[Ó)÷ 2Ü˜%Ÿ+™+¤Ó7÷2ä�Š˜uŸ{™{¨DÓ1ð 	ô
 œZÑ'ˆØ‹?ØÓ$Ö-CÜ ðØ#˜Hð %%ð%óð øô Ð?À¸xÀqÐIÓJÐJäˆEƒ{‡�×ÑÜ!ð/ó
ð 	
ð
 €Lr0   c	           	     ó   ^^^^^^	^^• [        TU40 T	D6  [        TU R                  5      (       a  [        U R                  SS9mTS:X  a'  [	        UR                  5      (       d  [        S5      eSm[        T5      m[        U5      m[        R                  " STS9m[        UT5      mS	UUU	UUUUU4S jjn
[        R                  " X¢U 5        g)
zÁ
Column-wise application of _interpolate_1d.

Notes
-----
Alters 'data' in-place.

The signature does differ from _interpolate_1d because it only
includes what is needed for Block.interpolate.
F)Úcompatrb   zStime-weighted interpolation only works on Series or DataFrames with a DatetimeIndexrd   N)ÚnobsÚlimitc                ó0   >• [        STU TTTTTSTS.	TD6  g )NF)	ÚindicesÚyvaluesrT   rª   r�   r—   Ú
fill_valueÚbounds_errorr,   rR   )Ú_interpolate_1d)	r­   r®   r¬   rx   rª   Úlimit_area_validatedr�   r,   rT   s	    €€€€€€€€r.   ÚfuncÚ$interpolate_2d_inplace.<locals>.func˜  s7   ø€ ô 	ð 	
ØØØØØ+Ø+Ø!ØØñ	
ð ó	
r0   )r­   ú
np.ndarrayÚreturnÚNone)rz   r   r5   r   r   r*   r’   r™   r   Úvalidate_limitÚ_index_to_interp_indicesr9   Úapply_along_axis)Údatarc   r�   rT   rª   r�   r—   r®   r,   rx   r²   r¬   r±   s      ``` ``` @@r.   Úinterpolate_2d_inplacer»   k  s¶   ÿ€ ô. ˜ Ñ0¨Ò0ä˜Z¨¯©×4Ñ4Ü'¨¯
©
¸5ÑAˆ
à�ÓÜ" 5§;¡;×/Ñ/Üð óð ð
 ˆä.¨Ó?€OÜ.¨zÓ:Ðô × Ò  d°%Ñ8€Eä& u¨fÓ5€G÷
ö 
ô  ×Ò˜ DÕ)r0   c                ó\  • U R                   n[        UR                  5      (       a  UR                  S5      nUS:X  a  Un[	        [
        R                  U5      nU$ [
        R                  " U5      nUS;   a4  UR                  [
        R                  :X  a  [        R                  " U5      nU$ )z=
Convert Index to ndarray of indices to pass to NumPy/SciPy.
Úi8ra   )rd   rc   )Ú_valuesr   r5   Úviewr   r9   rH   ÚasarrayÚobject_r   Úmaybe_convert_objects)rc   rT   ÚxarrÚindss       r.   r¸   r¸   «  s‹   € ð �=‰=€DÜ˜4Ÿ:™:×&Ñ&à�y‰y˜‹ˆà�ÓØˆÜ”B—J‘J Ó%ˆð €Kô �zŠz˜$ÓˆàÐ(Ó(Ø�z‰zœRŸZ™ZÓ'Ü×0Ò0°Ó6�à€Kr0   c
                óî  • U	b  U	nO[        U5      nU) nUR                  5       (       d  gUR                  5       (       a  g[        R                  " U5      n[        SUS9nUc  Sn[        R                  " U5      n[        SUS9nUc  [        U5      n[        R                  " SU-   [        U5      5      nUS:X  a"  [        R                  " U[        X³S5      5      nOIUS:X  a#  [        R                  " U[        USU5      5      nO [        R                  " [        X³U5      5      nUS	:X  a/  [        R                  " UU5      n[        R                  " UU5      nOHUS
:X  aB  [        R                  " XßSS9n[        R                  " UUSS9n[        R                  " UU5      nUR                  R                  S;   nU(       a  UR                  S5      nU[        ;   a?  [        R                   " X   5      n[        R"                  " X   X   U   X   U   5      X'   O[%        X   X   X   4UUUUS.U
D6X'   U	b  SU	SS& SU	U'   gU(       a  [&        R(                  UU'   g[        R*                  UU'   g)zõ
Logic for the 1-d interpolation.  The input
indices and yvalues will each be 1-d arrays of the same length.

Bounds_error is currently hardcoded to False since non-scipy ones don't
take it as an argument.

Notes
-----
Fills 'yvalues' in-place.
Nr|   )r†   r‡   r   r}   r   rŒ   r�   r”   r•   T©Úassume_uniquerŸ   r½   )rT   r®   r¯   rs   F)r   r„   Úallr9   ÚflatnonzerorŠ   Úaranger)   Úunion1dÚ_interp_limitÚuniqueÚ	setdiff1dr5   r;   r¿   ru   ÚargsortÚinterpÚ_interpolate_scipy_wrapperr   r+   Únan)r¬   r­   rT   rª   r�   r—   r®   r¯   rs   r,   rx   Úinvalidry   Úall_nansÚfirst_valid_indexÚ
start_nansÚlast_valid_indexÚend_nansÚpreserve_nansÚmid_nansÚis_datetimelikeÚindexers                         r.   r°   r°   Á  sV  € ð0 ÑØ‰ä�w“-ˆØˆH€Eà�9‰9�;‰;Øà‡y�y‡{�{Øô �~Š~˜gÓ&€Hä(¨W¸uÑEÐØÑ ØÐÜ—’Ð,Ó-€Jä'¨F¸UÑCÐØÑÜ˜w›<ÐÜ�yŠy˜Ð-Ñ-¬s°5«zÓ:€Hð ˜)Ó#ÜŸ
š
 :¬}¸WÈQÓ/OÓP‰Ø	˜JÓ	&ÜŸ
š
 8¬]¸7ÀAÀuÓ-MÓN‰ô Ÿ	š	¤-°ÀÓ"FÓGˆð �XÓäŸ
š
 =°*Ó=ˆÜŸ
š
 =°(Ó;‰Ø	�yÓ	 ä—<’< ÀDÑIˆÜ—<’< ¨(À$ÑGˆÜŸ
š
 =°(Ó;ˆà—m‘m×(Ñ(¨DÑ0€OæØ—,‘,˜tÓ$ˆà”Óô —*’*˜W™^Ó,ˆÜŸ9š9ØÑ˜g™n¨WÑ5°w±~ÀgÑ7Nó
ˆÒô 6Ø‰NØ‰NØÑð	
ð Ø!Ø%Øñ	
ð ñ	
ˆÑð ÑØˆ‰QˆØ"ˆˆ]Ñð
 ö	 
Ü!$§¡ˆ�Ñð ô "$§¡ˆ�ÑØ
r0   c                ó>  • U S3n[        SUS9  SSKJn	  [        R                  " U5      nU	R
                  U	R                  [        [        [        [        U	R                  S.n
/ SQnX;;   a&  US:X  a  UnOUnU	R                  XXÄUS	9nU" U5      nU$ US
:X  aC  [        U5      (       d  US::  a  [        SU 35      eU	R                  " X4SU0UD6nU" U5      nU$ U R                  R                   (       d  U R#                  5       n UR                  R                   (       d  UR#                  5       nUR                  R                   (       d  UR#                  5       nU
R%                  US5      nUc  [        SU S35      eUR'                  SS5        U" XU40 UD6nU$ )z¥
Passed off to scipy.interpolate.interp1d. method is scipy's kind.
Returns an array interpolated at new_x.  Add any new methods to
the list in _clean_interp_method.
z interpolation requires SciPy.Úscipy)Úextrar   ©Úinterpolate)ri   rj   rm   rn   rq   rp   ro   )r\   re   rf   rg   rh   rl   rl   )r;   r®   r¯   rk   z;order needs to be specified and greater than 0; got order: ÚkNr    r–   Údowncast)r   rÞ   rá   r9   rÀ   Úbarycentric_interpolateÚkrogh_interpolateÚ_from_derivativesÚ_cubicspline_interpolateÚ_akima_interpolateÚpchip_interpolateÚinterp1dr   r*   ÚUnivariateSplineÚflagsÚ	writeableÚcopyrt   Úpop)ÚxÚyÚnew_xrT   r®   r¯   rs   rx   rß   rá   Úalt_methodsÚinterp1d_methodsr;   ÚterpÚnew_ys                  r.   rÑ   rÑ   1  s¢  € ð ˆhÐ4Ð5€EÜ˜w¨eÒ4Ý!ä�JŠJ�uÓ€Eð #×:Ñ:Ø×.Ñ.Ü-Ü 1Ü/Ü#Ø×.Ñ.ñ9€KòÐð Ó!Ø�\Ó!Ø‰DàˆDØ×#Ñ#Ø�tÀð $ð 
ˆñ �U“ˆð2 €Lð1 
�8Ó	ä��;‰;˜5 A›:ÜØMÈeÈWÐUóð ð ×+Ò+¨AÑD°EÐD¸VÑDˆÙ�U“ˆð" €Lð �w‰w× × Ø—‘“ˆAØ�w‰w× × Ø—‘“ˆAØ�{‰{×$×$Ø—J‘J“LˆEØ�‰˜v tÓ,ˆØ‰<ÜÐ?À¸xÀqÐIÓJÐJð 	�
‰
�:˜tÔ$Ù�Q˜5Ñ+ FÑ+ˆØ€Lr0   c                óx   • SSK Jn  UR                  R                  nU" XR	                  SS5      X5S9nU" U5      $ )a/  
Convenience function for interpolate.BPoly.from_derivatives.

Construct a piecewise polynomial in the Bernstein basis, compatible
with the specified values and derivatives at breakpoints.

Parameters
----------
xi : array-like
    sorted 1D array of x-coordinates
yi : array-like or list of array-likes
    yi[i][j] is the j-th derivative known at xi[i]
order: None or int or array-like of ints. Default: None.
    Specifies the degree of local polynomials. If not None, some
    derivatives are ignored.
der : int or list
    How many derivatives to extract; None for all potentially nonzero
    derivatives (that is a number equal to the number of points), or a
    list of derivatives to extract. This number includes the function
    value as 0th derivative.
 extrapolate : bool, optional
    Whether to extrapolate to ouf-of-bounds points based on first and last
    intervals, or to return NaNs. Default: True.

See Also
--------
scipy.interpolate.BPoly.from_derivatives

Returns
-------
y : scalar or array-like
    The result, of length R or length M or M by R.
r   rà   r‚   r   )ÚordersÚextrapolate)rÞ   rá   ÚBPolyrm   Úreshape)	ÚxiÚyirð   rs   Úderrù   rá   rT   Úms	            r.   ræ   ræ   ~  s;   € õR "ð ×Ñ×/Ñ/€FÙˆr—:‘:˜b !Ó$¨UÑL€AáˆQ‹4€Kr0   c                ó:   • SSK Jn  UR                  XUS9nU" X#S9$ )aQ  
Convenience function for akima interpolation.
xi and yi are arrays of values used to approximate some function f,
with ``yi = f(xi)``.

See `Akima1DInterpolator` for details.

Parameters
----------
xi : np.ndarray
    A sorted list of x-coordinates, of length N.
yi : np.ndarray
    A 1-D array of real values.  `yi`'s length along the interpolation
    axis must be equal to the length of `xi`. If N-D array, use axis
    parameter to select correct axis.
x : np.ndarray
    Of length M.
der : int, optional
    How many derivatives to extract. This number includes the function
    value as 0th derivative.
axis : int, optional
    Axis in the yi array corresponding to the x-coordinate values.

See Also
--------
scipy.interpolate.Akima1DInterpolator

Returns
-------
y : scalar or array-like
    The result, of length R or length M or M by R,

r   rà   r€   )Únu)rÞ   rá   ÚAkima1DInterpolator)rü   rý   rð   rþ   r�   rá   ÚPs          r.   rè   rè   °  s'   € õP "à×'Ñ'¨°TÐ'Ð:€AáˆQ‰<Ðr0   c                ó@   • SSK Jn  UR                  XX4US9nU" U5      $ )ak  
Convenience function for cubic spline data interpolator.

See `scipy.interpolate.CubicSpline` for details.

Parameters
----------
xi : np.ndarray, shape (n,)
    1-d array containing values of the independent variable.
    Values must be real, finite and in strictly increasing order.
yi : np.ndarray
    Array containing values of the dependent variable. It can have
    arbitrary number of dimensions, but the length along ``axis``
    (see below) must match the length of ``x``. Values must be finite.
x : np.ndarray, shape (m,)
axis : int, optional
    Axis along which `y` is assumed to be varying. Meaning that for
    ``x[i]`` the corresponding values are ``np.take(y, i, axis=axis)``.
    Default is 0.
bc_type : string or 2-tuple, optional
    Boundary condition type. Two additional equations, given by the
    boundary conditions, are required to determine all coefficients of
    polynomials on each segment [2]_.
    If `bc_type` is a string, then the specified condition will be applied
    at both ends of a spline. Available conditions are:
    * 'not-a-knot' (default): The first and second segment at a curve end
      are the same polynomial. It is a good default when there is no
      information on boundary conditions.
    * 'periodic': The interpolated functions is assumed to be periodic
      of period ``x[-1] - x[0]``. The first and last value of `y` must be
      identical: ``y[0] == y[-1]``. This boundary condition will result in
      ``y'[0] == y'[-1]`` and ``y''[0] == y''[-1]``.
    * 'clamped': The first derivative at curves ends are zero. Assuming
      a 1D `y`, ``bc_type=((1, 0.0), (1, 0.0))`` is the same condition.
    * 'natural': The second derivative at curve ends are zero. Assuming
      a 1D `y`, ``bc_type=((2, 0.0), (2, 0.0))`` is the same condition.
    If `bc_type` is a 2-tuple, the first and the second value will be
    applied at the curve start and end respectively. The tuple values can
    be one of the previously mentioned strings (except 'periodic') or a
    tuple `(order, deriv_values)` allowing to specify arbitrary
    derivatives at curve ends:
    * `order`: the derivative order, 1 or 2.
    * `deriv_value`: array-like containing derivative values, shape must
      be the same as `y`, excluding ``axis`` dimension. For example, if
      `y` is 1D, then `deriv_value` must be a scalar. If `y` is 3D with
      the shape (n0, n1, n2) and axis=2, then `deriv_value` must be 2D
      and have the shape (n0, n1).
extrapolate : {bool, 'periodic', None}, optional
    If bool, determines whether to extrapolate to out-of-bounds points
    based on first and last intervals, or to return NaNs. If 'periodic',
    periodic extrapolation is used. If None (default), ``extrapolate`` is
    set to 'periodic' for ``bc_type='periodic'`` and to True otherwise.

See Also
--------
scipy.interpolate.CubicHermiteSpline

Returns
-------
y : scalar or array-like
    The result, of shape (m,)

References
----------
.. [1] `Cubic Spline Interpolation
        <https://en.wikiversity.org/wiki/Cubic_Spline_Interpolation>`_
        on Wikiversity.
.. [2] Carl de Boor, "A Practical Guide to Splines", Springer-Verlag, 1978.
r   rà   )r�   Úbc_typerù   )rÞ   rá   ÚCubicSpline)rü   rý   rð   r�   r  rù   rá   r  s           r.   rç   rç   ß  s/   € õZ "à×ÑØ
�T¸ð 	 ð 	€Añ ˆQ‹4€Kr0   c                óä   • US:X  a  S OS nU R                   S:X  a0  US:w  a  [        S5      eU R                  S/U R                  Q75      n [	        U5      nU" U 5      n[        USS9nU" XcUS9  g	)
aÖ  
Perform an actual interpolation of values, values will be make 2-d if
needed fills inplace, returns the result.

Parameters
----------
values: np.ndarray
    Input array.
method: str, default "pad"
    Interpolation method. Could be "bfill" or "pad"
axis: 0 or 1
    Interpolation axis
limit: int, optional
    Index limit on interpolation.
limit_area: str, optional
    Limit area for interpolation. Can be "inside" or "outside"

Notes
-----
Modifies values in-place.
r   c                ó   • U $ rQ   rR   ©rð   s    r.   Ú<lambda>Ú)pad_or_backfill_inplace.<locals>.<lambda>Q  s   € ™r0   c                ó   • U R                   $ rQ   )ÚTr	  s    r.   r
  r  Q  s   € ¸¿ºr0   r   z1cannot interpolate on an ndim == 1 with axis != 0r~   )rƒ   )rª   r—   N)rƒ   ÚAssertionErrorrû   rD   rU   Úget_fill_func)rd   rT   r�   rª   r—   ÚtransfÚtvaluesr²   s           r.   Úpad_or_backfill_inplacer  5  su   € ð8 # a›iŠk©m€Fð ‡{�{�aÓØ�1‹9Ü Ð!TÓUÐUØ—‘ Ð 2 V§\¡\Ñ 2Ó3ˆä˜vÓ&€FÙ�V‹n€Gä˜ aÑ(€Dáˆ¨*Ó5r0   c                ó"   • Uc  [        U 5      nU$ rQ   )r   )rd   r,   s     r.   Ú_fillna_prepr  a  s   € ð
 �|Ü�F‹|ˆà€Kr0   c                ó`   ^ • [        T 5         S   SU 4S jjj5       n[        [        U5      $ )z6
Wrapper to handle datetime64 and timedelta64 dtypes.
c                óÎ   >• [        U R                  5      (       aD  Uc  [        U 5      nT" U R                  S5      XUS9u  pCUR                  U R                  5      U4$ T" XX#S9$ )Nr½   )rª   r—   r,   )r   r5   r   r¿   )rd   rª   r—   r,   Úresultr²   s        €r.   Únew_funcÚ&_datetimelike_compat.<locals>.new_funcq  se   ø€ ô ˜vŸ|™|×,Ñ,Ø‰|ä˜F“|�áØ—‘˜DÓ!¨ÈDñ‰LˆFð —;‘;˜vŸ|™|Ó,¨dÐ2Ð2á�F°JÑJÐJr0   ©NNN)rª   ú
int | Noner—   ú#Literal['inside', 'outside'] | None)r   r   r   )r²   r  s   ` r.   Ú_datetimelike_compatr  l  sK   ø€ ô
 ˆ4ƒ[ð !Ø:>Øð	KàðKð 8÷Kó ðKô$ ”�8ÓÐr0   c                óŽ   • [        X5      nUb   UR                  5       (       d  [        X25        [        R                  " XUS9  X4$ ©N)rª   )r  rÈ   Ú_fill_limit_area_1dr   Úpad_inplace©rd   rª   r—   r,   s       r.   Ú_pad_1dr#  ‡  s>   € ô ˜Ó%€DØÑ d§h¡h§j¡jÜ˜DÔ-Ü	×Ò�f¨%Ò0Øˆ<Ðr0   c                óŽ   • [        X5      nUb   UR                  5       (       d  [        X25        [        R                  " XUS9  X4$ r  )r  rÈ   r   r   Úbackfill_inplacer"  s       r.   Ú_backfill_1dr&  •  s>   € ô ˜Ó%€DØÑ d§h¡h§j¡jÜ˜DÔ-Ü	×Ò˜6¨uÒ5Øˆ<Ðr0   c                ó†   • [        X5      nUb  [        X25        U R                  (       a  [        R                  " XUS9  X4$ r  )r  Ú_fill_limit_area_2dÚsizer   Úpad_2d_inplacer"  s       r.   Ú_pad_2dr+  £  s;   € ô ˜Ó%€DØÑÜ˜DÔ-à‡{‡{Ü×Ò˜V°Ò7Øˆ<Ðr0   c                óŽ   • [        X5      nUb  [        X25        U R                  (       a  [        R                  " XUS9  X4$  X4$ r  )r  r(  r)  r   Úbackfill_2d_inplacer"  s       r.   Ú_backfill_2dr.  ³  sJ   € ô ˜Ó%€DØÑÜ˜DÔ-à‡{‡{Ü×!Ò! &°eÒ<ð ˆ<Ðð 	Øˆ<Ðr0   c                ó¶   • U ) nUR                  5       n[        U5      USSS2   R                  5       -
  S-
  nUS:X  a  SU SU& SXS-   S& gUS:X  a  SXS-   U& gg)a¯  Prepare 1d mask for ffill/bfill with limit_area.

Caller is responsible for checking at least one value of mask is False.
When called, mask will no longer faithfully represent when
the corresponding are NA or not.

Parameters
----------
mask : np.ndarray[bool, ndim=1]
    Mask representing NA values when filling.
limit_area : { "outside", "inside" }
    Whether to limit filling to outside or inside the outer most non-NA value.
Nr‚   r   r”   Fr•   )r…   r)   )r,   r—   Úneg_maskr|   r}   s        r.   r   r   Æ  sw   € ð  ˆu€HØ�O‰OÓ€EÜˆx‹=˜8¡D b D™>×0Ñ0Ó2Ñ2°QÑ6€DØ�XÓØˆˆVˆeˆØ ˆ�A‰XˆZÑØ	�yÓ	 Ø!&ˆ�Q‰Y˜Ñð 
!r0   c                óp  • U R                   ) nUS:X  aJ  [        R                  R                  USS9[        R                  R                  USSS2   SS9SSS2   -  nOK[        R                  R                  USS9) [        R                  R                  USSS2   SS9SSS2   ) -  nSXR                   '   g)ag  Prepare 2d mask for ffill/bfill with limit_area.

When called, mask will no longer faithfully represent when
the corresponding are NA or not.

Parameters
----------
mask : np.ndarray[bool, ndim=1]
    Mask representing NA values when filling.
limit_area : { "outside", "inside" }
    Whether to limit filling to outside or inside the outer most non-NA value.
r•   r   r€   Nr‚   F)r  r9   ÚmaximumÚ
accumulate)r,   r—   r0  Úla_masks       r.   r(  r(  à  sÂ   € ð —‘ˆw€HØ�YÓô �J‰J×!Ñ! (°Ð!Ð3Ü�j‰j×#Ñ# H©T¨r¨T¡N¸Ð#Ð;¹D¸b¸DÑAñBñ 	ô �Z‰Z×"Ñ" 8°!Ð"Ð4Ð4Ü�z‰z×$Ñ$ X©d°¨d¡^¸!Ð$Ð<¹T¸r¸TÑBÐBñCð 	ð €D�‰‚Or0   ©rY   r[   c                óV   • [        U 5      n US:X  a	  [        U    $ [        [        S.U    $ )Nr   r5  )rU   Ú_fill_methodsr+  r.  )rT   rƒ   s     r.   r  r    s.   € Ü˜vÓ&€FØˆqƒyÜ˜VÑ$Ð$Ü¬Ñ5°fÑ=Ð=r0   c                ó   • U c  g [        U SS9$ )NTrN   )rU   )rT   s    r.   Úclean_reindex_fill_methodr9  	  s   € Ø�~ØÜ˜V°4Ñ8Ð8r0   c                óŽ  ^• [        U 5      m[        R                  " / [        R                  S9n[        R                  " / [        R                  S9nSnS
U4S jjnUb*  US:X  a  [        R                  " U 5      S   nSnOU" X5      nUb%  US:X  a  U$ TS-
  U" U SSS2   U5      -
  nUS:X  a  U$ [        R
                  " X4US	9$ )a  
Get indexers of values that won't be filled
because they exceed the limits.

Parameters
----------
invalid : np.ndarray[bool]
fw_limit : int or None
    forward limit to index
bw_limit : int or None
    backward limit to index

Returns
-------
set of indexers

Notes
-----
This is equivalent to the more readable, but slower

.. code-block:: python

    def _interp_limit(invalid, fw_limit, bw_limit):
        for x in np.where(invalid)[0]:
            if invalid[max(0, x - fw_limit) : x + bw_limit + 1].all():
                yield x
r4   Tc           	     ó\  >• [        UTS-
  5      n[        R                  R                  R	                  XS-   5      R                  S5      n[        R                  " [        R                  " U5      S   U-   [        R                  " U S US-    ) R                  5       S:H  5      S   5      nU$ )Nr   r   )	Úminr9   r   Ústride_tricksÚsliding_window_viewrÈ   rË   ÚwhereÚcumsum)rÓ   rª   ÚwindowedÚidxÚNs       €r.   ÚinnerÚ_interp_limit.<locals>.inner5  s•   ø€ Ü�E˜1˜q™5Ó!ˆÜ—6‘6×'Ñ'×;Ñ;¸GÈQÁYÓO×SÑSÐTUÓVˆÜ�jŠjÜ�HŠH�XÓ˜qÑ! EÑ)Ü�HŠH�w˜{ ¨¡Ð+Ð+×3Ñ3Ó5¸Ñ:Ó;¸AÑ>ó
ˆð ˆ
r0   Nr   Fr   r‚   rÆ   )rª   Úint)r)   r9   ÚarrayÚint64r?  Úintersect1d)rÓ   Úfw_limitÚbw_limitÚf_idxÚb_idxrÇ   rD  rC  s          @r.   rÌ   rÌ     sÀ   ø€ ôB 	ˆG‹€AÜ�HŠH�RœrŸx™xÑ(€EÜ�HŠH�RœrŸx™xÑ(€EØ€M÷ð ÑØ�q‹=Ü—H’H˜WÓ% aÑ(ˆEØ!‰Má˜'Ó,ˆEàÑØ�q‹=ð ˆLà˜‘E™E '©$¨B¨$¡-°Ó:Ñ:ˆEØ˜1‹}Ø�ä�>Š>˜%°mÑDÐDr0   )r,   únpt.NDArray[np.bool_]r-   rF  )rI   r   rµ   rN  )rT   z,Literal['ffill', 'pad', 'bfill', 'backfill']rO   zLiteral[False]rµ   úLiteral['pad', 'backfill'])rT   ú7Literal['ffill', 'pad', 'bfill', 'backfill', 'nearest']rO   zLiteral[True]rµ   ú%Literal['pad', 'backfill', 'nearest'])rT   rP  rO   rE   rµ   rQ  )rT   rG   rc   r"   rµ   rG   )r†   rG   r‡   rN  rµ   r  )r�   rG   rµ   z&Literal['forward', 'backward', 'both'])r—   ú
str | Nonerµ   r  )r�   z-Literal['backward', 'forward', 'both'] | NonerT   rG   rµ   z&Literal['backward', 'forward', 'both'])rc   r"   rµ   r"   )ra   NrŒ   NNN)rº   r´   rc   r"   r�   r   rT   rG   rª   r  r�   rG   r—   rR  r®   ú
Any | Nonerµ   r¶   )rc   r"   rT   rG   rµ   r´   )ra   NrŒ   NNFNN)r¬   r´   r­   r´   rT   rG   rª   r  r�   rG   r—   r  r®   rS  r¯   rE   rs   r  rµ   r¶   )NFN)
rð   r´   rñ   r´   rò   r´   rT   rG   r¯   rE   )Nr   F)
rü   r´   rý   r´   rð   r´   rþ   zint | list[int] | Nonerù   rE   )r   r   )
rü   r´   rý   r´   rð   r´   rþ   rF  r�   r   )r   r#   N)rü   r´   rý   r´   rð   r´   r�   r   r  z_CubicBC | tuple[Any, Any]rù   z!Literal['periodic'] | bool | Nonerµ   r´   )rY   r   NN)rd   r´   rT   rO  r�   r   rª   r  r—   r  rµ   r¶   rQ   )r,   únpt.NDArray[np.bool_] | Nonerµ   rN  )r²   r   rµ   r   r  )
rd   r´   rª   r  r—   r  r,   rT  rµ   z(tuple[np.ndarray, npt.NDArray[np.bool_]])rª   r  r—   r  r,   rT  )r,   rN  r—   zLiteral['outside', 'inside']rµ   r¶   )r   )rƒ   rF  )rµ   zReindexMethod | None)rÓ   rN  rJ  r  rK  r  rµ   r´   )QÚ__doc__Ú
__future__r   Ú	functoolsr   Útypingr   r   r   r   r	   Únumpyr9   Úpandas._configr
   Úpandas._libsr   r   r   Úpandas._typingr   r   r   r   r   Úpandas.compat._optionalr   Úpandas.core.dtypes.castr   Úpandas.core.dtypes.commonr   r   r   r   r   Úpandas.core.dtypes.dtypesr   r   r   Úpandas.core.dtypes.missingr   r   r   Úcollections.abcr    r!   r¡   r"   r'   Ú__annotations__r/   rM   rU   ru   rv   rz   rŠ   r’   r™   rœ   r¦   r»   r¸   r°   rÑ   ræ   rè   rç   r  r  r  r#  r&  r+  r.  r   r(  r7  r  r9  rÌ   rR   r0   r.   Ú<module>rd     s�  ðòõ #å ÷õ ó å $÷ñ ÷
õ õ ?å 4÷õ ÷ñ ÷
ñ ö Ý(Ý åà!Ð"PÑQ€HˆiÓQôôLð^ 
ð %(ñ%Ø8ð%ð "ð%ð  ô	%ó 
ð%ð 
ð0ØCð0ð !ð0ð +ó	0ó 
ð0ð  ñØCðð ðð +õ	ò4 3€
ò€
ô$ô&$ðNØðà+ôôðØBðØLOðà+ôô* ðN ØØ$Ø!Ø!Ø	ð=*Ø
ð=*àð=*ð ð=*ð ð	=*ð
 ð=*ð ð=*ð ð=*ð ð=*ð 
õ=*ô@ð2 ØØ$Ø6:Ø!ØØØ	ðmØðmàðmð ðmð ð	mð
 ðmð 4ðmð ðmð ðmð ðmð 
õmðj ØØ
ðJØðJàðJð ðJð ð	Jð õJðb Ø"#Øð/Øð/àð/ð ð/ð
 
 ð/ð õ/ðl Øð,Øð,àð,ð ð,ð 
ð	,ð
 õ,ðf Ø*6Ø59ðSØðSàðSð ðSð ð	Sð
 (ðSð 3ðSð õSðp */ØØØ6:ð)6Øð)6à&ð)6ð ð)6ð ð	)6ð
 4ð)6ð 
õ)6ðZ 26ðØ.ðàõôð6 ð Ø6:Ø)-ð	
Øð
àð
ð 4ð
ð 'ð	
ð
 .ô
ó ð
ð ð Ø6:Ø)-ð	
Øð
àð
ð 4ð
ð 'ð	
ð
 .ô
ó ð
ð ð Ø6:Ø)-ð	Øðàðð 4ðð 'ð	ð
 .ôó ðð ð Ø6:Ø)-ð	àðð 4ðð 'ô	ó ðð$'Ø
ð'Ø-Ið'à	ô'ð4Ø
ðØ-Iðà	ôð>  ¨\Ñ:€ö>ô9ð@EØ"ð@EØ.8ð@EØDNð@Eàõ@Er0   