
    I jp                       S r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
JrJr  SSKrSSKJrJr  SSKJrJr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#  SSK$J%r%  SSK&J'r'J(r(  SSK)J*r*  SSK+J,r,J-r-  SSK.J/r/J0r0J1r1J2r2  SSK3J4s  J5r6  SSK7J4s  J8s  J9r:  SSK7J;r;  SSK<J=r=  SSK>J?r?  SSK@JArA  \(       a  SSKBJCrC  SSKDJDrD  SSKEJFrFJGrGJHrHJIrI  SSKJJKrK  \L" \:R                  5      rM " S S\=\5      rN " S S\N\5      rOg)z;
Base and utility classes for tseries type pandas objects.
    )annotations)ABCabstractmethod)TYPE_CHECKINGAnyLiteralSelfcastfinalN)NaTlib)
BaseOffset
ResolutionTick	Timedelta	Timestampparsing	to_offset)abbrev_to_npy_unit)function)InvalidIndexErrorNullFrequencyErrorOutOfBoundsDatetimeOutOfBoundsTimedelta)cache_readonly)
is_integeris_list_like)concat_compat)CategoricalDtypePeriodDtype)DatetimeArrayExtensionArrayPeriodArrayTimedeltaArray)Index)NDArrayBackedExtensionIndex)
RangeIndex)to_timedelta)Sequence)datetime)AxisJoinHowTimeUnitnpt)CategoricalIndexc                    ^  \ rS rSr% SrSrS\S'   SSS.S$S	 jjr\S%S
 j5       r	\	R                  S&S j5       r	\S'S j5       r\S(S j5       r\\S)S j5       5       r\S(S j5       r\S*S j5       rS+S jrS,S jrU 4S jrSrSS.       S-S jjr\S 5       rU 4S jrS.S(U 4S jjjr\S/S j5       rS0S jrS1S jrS2S jr\      S3S j5       rS4S  jr S5S6S! jjr!S" r"S#r#U =r$$ )7DatetimeIndexOpsMixinX   zE
Common ops mixin to support a unified interface datetimelike Index.
Fz,DatetimeArray | TimedeltaArray | PeriodArray_dataTr   skipnaaxisc               4    U R                   R                  XS9$ )a  
Return the mean value of the Array.

Parameters
----------
skipna : bool, default True
    Whether to ignore any NaT elements.
axis : int, optional, default 0
    Axis for the function to be applied on.

Returns
-------
scalar
    Timestamp or Timedelta.

See Also
--------
numpy.ndarray.mean : Returns the average of array elements along a given axis.
Series.mean : Return the mean value in a Series.

Notes
-----
mean is only defined for Datetime and Timedelta dtypes, not for Period.

Examples
--------
For :class:`pandas.DatetimeIndex`:

>>> idx = pd.date_range("2001-01-01 00:00", periods=3)
>>> idx
DatetimeIndex(['2001-01-01', '2001-01-02', '2001-01-03'],
              dtype='datetime64[us]', freq='D')
>>> idx.mean()
Timestamp('2001-01-02 00:00:00')

For :class:`pandas.TimedeltaIndex`:

>>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="D")
>>> tdelta_idx
TimedeltaIndex(['1 days', '2 days', '3 days'],
                dtype='timedelta64[s]', freq=None)
>>> tdelta_idx.mean()
Timedelta('2 days 00:00:00')
r4   )r3   mean)selfr5   r6   s      q/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/pandas/core/indexes/datetimelike.pyr8   DatetimeIndexOpsMixin.mean`   s    Z zzf88    c                .    U R                   R                  $ )a  
Return the frequency object if it is set, otherwise None.

To learn more about the frequency strings, please see
:ref:`this link<timeseries.offset_aliases>`.

See Also
--------
DatetimeIndex.freq : Return the frequency object if it is set, otherwise None.
PeriodIndex.freq : Return the frequency object if it is set, otherwise None.

Examples
--------
>>> datetimeindex = pd.date_range(
...     "2022-02-22 02:22:22", periods=10, tz="America/Chicago", freq="h"
... )
>>> datetimeindex
DatetimeIndex(['2022-02-22 02:22:22-06:00', '2022-02-22 03:22:22-06:00',
               '2022-02-22 04:22:22-06:00', '2022-02-22 05:22:22-06:00',
               '2022-02-22 06:22:22-06:00', '2022-02-22 07:22:22-06:00',
               '2022-02-22 08:22:22-06:00', '2022-02-22 09:22:22-06:00',
               '2022-02-22 10:22:22-06:00', '2022-02-22 11:22:22-06:00'],
              dtype='datetime64[us, America/Chicago]', freq='h')
>>> datetimeindex.freq
<Hour>
r3   freqr9   s    r:   r?   DatetimeIndexOpsMixin.freq   s    8 zzr<   c                $    XR                   l        g Nr>   )r9   values     r:   r?   rA      s      

r<   c                .    U R                   R                  $ rC   )r3   asi8r@   s    r:   rF   DatetimeIndexOpsMixin.asi8       zzr<   c                    SSK Jn  U R                  R                  bL  [	        U R                  [
        U45      (       a+  [        U R                  R                  5      R                  nU$ U R                  R                  $ )a^  
Return the frequency object as a string if it's set, otherwise None.

See Also
--------
DatetimeIndex.inferred_freq : Returns a string representing a frequency
    generated by infer_freq.

Examples
--------
For DatetimeIndex:

>>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00"], freq="D")
>>> idx.freqstr
'D'

The frequency can be inferred if there are more than 2 points:

>>> idx = pd.DatetimeIndex(
...     ["2018-01-01", "2018-01-03", "2018-01-05"], freq="infer"
... )
>>> idx.freqstr
'2D'

For PeriodIndex:

>>> idx = pd.PeriodIndex(["2023-1", "2023-2", "2023-3"], freq="M")
>>> idx.freqstr
'M'
r   )PeriodIndex)	pandasrJ   r3   freqstr
isinstancer#   r    r?   _freqstr)r9   rJ   r?   s      r:   rL   DatetimeIndexOpsMixin.freqstr   sa    @ 	'::)jJJk2/
 /
 tzz/88DK::%%%r<   c                    g rC    r@   s    r:   _resolution_obj%DatetimeIndexOpsMixin._resolution_obj   s    -0r<   c                .    U R                   R                  $ )z?
Returns day, hour, minute, second, millisecond or microsecond
)r3   
resolutionr@   s    r:   rU    DatetimeIndexOpsMixin.resolution   s    
 zz$$$r<   c                .    U R                   R                  $ rC   )r3   _hasnar@   s    r:   hasnansDatetimeIndexOpsMixin.hasnans   s    zz   r<   c                n   U R                  U5      (       a  g[        U[        5      (       d  gUR                  R                  S;   a  g[        U[        U 5      5      (       d  SnU R                  R                  nUR                  [        :X  a  UR                  U;   nOD[        UR                  [        5      (       a%  [        SU5      nUR                  R                  U;   nU(       a   [        U 5      " U5      n[        U 5      [        U5      :w  a  gU R                  UR                  :X  a+  [         R"                  " U R$                  UR$                  5      $ U R                  R                  S:X  a  U R&                  UR&                  :X  d  U R                  R                  S:X  a]   U R                  R)                  UR                  5      u  pE[         R"                  " UR+                  S5      UR+                  S5      5      $ g! [        [        [        4 a     gf = f! [,        [.        4 a     gf = f)z<
Determines if two Index objects contain the same elements.
TFiufcr/   Mmi8)is_rM   r%   dtypekindtyper3   _infer_matchesobjectinferred_typer   r
   
categories
ValueError	TypeErrorOverflowErrornparray_equalrF   tz_ensure_matching_resosviewr   r   )r9   other
should_try	inferableleftrights         r:   equalsDatetimeIndexOpsMixin.equals   s    88E??%''[['E4:..J

11I{{f$"00I=
EKK)9::/7"--;;yH
! Ju-E :e$ZZ5;;&>>$))UZZ88jjoo$EHH)<TWAWI"jj??L ~~diiouzz$7GHH) #I}= !
 !!  ()=> s$   +H )'H! HH!H43H4c                ~    [        U5         U R                  U5        g! [        [        [        [
        4 a     gf = f)a  
Return a boolean indicating whether the provided key is in the index.

Parameters
----------
key : label
    The key to check if it is present in the index.

Returns
-------
bool
    Whether the key search is in the index.

Raises
------
TypeError
    If the key is not hashable.

See Also
--------
Index.isin : Returns an ndarray of boolean dtype indicating whether the
    list-like key is in the index.

Examples
--------
>>> idx = pd.Index([1, 2, 3, 4])
>>> idx
Index([1, 2, 3, 4], dtype='int64')
>>> 2 in idx
True
>>> 6 in idx
False
FT)hashget_locKeyErrorri   rh   r   )r9   keys     r:   __contains__"DatetimeIndexOpsMixin.__contains__  s@    D 	S		LL  )Z1BC 		s    <<c                |   > [         R                  " [        U5      R                  5       5      n[        TU ]  X5      $ rC   )rk   asarrayr(   to_numpysuper_convert_tolerance)r9   	tolerancetarget	__class__s      r:   r   (DatetimeIndexOpsMixin._convert_toleranceG  s/    JJ|I6??AB	w))<<r<   r   N)date_formatc               8    U[        U R                  X#S95      -   $ )N)na_repr   )list_get_values_for_csv)r9   headerr   r   s       r:   _format_with_header)DatetimeIndexOpsMixin._format_with_headerO  s)    
 $$F$L
 
 	
r<   c                6    U R                   R                  5       $ rC   )r3   
_formatterr@   s    r:   _formatter_func%DatetimeIndexOpsMixin._formatter_funcX  s    zz$$&&r<   c                   > [         TU ]  5       nU R                   H8  nUS:X  d  M  U R                  nUb  [	        U5      nUR                  SU45        M:     U$ )z8
Return a list of tuples of the (attr,formatted_value).
r?   )r   _format_attrs_attributesrL   reprappend)r9   attrsattribr?   r   s       r:   r   #DatetimeIndexOpsMixin._format_attrs\  sY     %'&&F||#:Dfd^, ' r<   c                h   > [         TU ]  US9nU R                  (       a  USU R                   3-  nU$ )z
Return a summarized representation.

Parameters
----------
name : str
    name to use in the summary representation

Returns
-------
String with a summarized representation of the index
namez
Freq: )r   _summaryr?   rL   )r9   r   resultr   s      r:   r   DatetimeIndexOpsMixin._summaryj  s8     !t!,99//Fr<   c                    XR                   :  $ rC   )rR   )r9   resos     r:   _can_partial_date_slice-DatetimeIndexOpsMixin._can_partial_date_slice  s     ****r<   c                    [         erC   NotImplementedError)r9   r   parseds      r:   _parsed_string_to_bounds.DatetimeIndexOpsMixin._parsed_string_to_bounds  s    !!r<   c           
         U R                   b  [        U R                   S5      (       a  U R                   nWb"  [	        U[
        5      (       d  UR                  nOUn[	        U[        R                  5      (       a  [        U5      n[        R                  " X5      u  pE[        R                  " U5      nXF4$ ! [         a    [        U S[        U SS 5      5      n Nf = f)N	rule_coderL   inferred_freq)r?   hasattrr   getattrrM   strr   rk   str_r   parse_datetime_string_with_resor   from_attrname)r9   labelr?   rL   r   reso_strr   s          r:   _parse_with_reso&DatetimeIndexOpsMixin._parse_with_reso  s    	Ryy GDII{$C$Cyy
 JtS$9$9nnGGeRWW%%JE"BB5R''1| # 	R4GD/4,PQD	Rs   4B8 8"CCc                    U R                  U5      u  p# U R                  X25      $ ! [         a  n[        U5      UeS nAff = frC   )r   _partial_date_slicerz   )r9   r{   r   r   errs        r:   _get_string_slice'DatetimeIndexOpsMixin._get_string_slice  sF    ,,S1	)++D99 	)3-S(	)s   & 
A<Ac                   U R                  U5      (       d  [        eU R                  X5      u  p4U R                  R                  nU R                  R
                  nU R                  (       am  [        U 5      (       a&  X0S   :  a  X@S   :  d  X0S   :  a  X@S   :  a  [        eUR                  U" U5      SS9nUR                  U" U5      SS9n[        Xx5      $ XV" U5      :  n	XV" U5      :*  n
X-  R                  5       S   $ )zc
Parameters
----------
reso : Resolution
parsed : datetime

Returns
-------
slice or ndarray[intp]
r   rs   sidert   )r   rh   r   r3   _ndarray_unboxis_monotonic_increasinglenrz   searchsortedslicenonzero)r9   r   r   t1t2valsunboxrs   rt   lhs_maskrhs_masks              r:   r   )DatetimeIndexOpsMixin._partial_date_slice  s      ++D11..t<zz""

!!''4yy1g"Aw,BbMbPR8m 
 $$U2YV$<D%%eBig%>E%% uRy(HuRy(H '002155r<   c                R   [        U[        5      (       a2   U R                  U5      u  p4U R                  WW5      u  pgUS:X  a  U$ U$ [        XR                  R                  5      (       d  U R	                  SU5        U$ ! [         a  nU R	                  SX5         SnANwSnAff = f)z
If label is a string, cast it to scalar type according to resolution.

Parameters
----------
label : object
side : {'left', 'right'}

Returns
-------
label : object

Notes
-----
Value of `side` parameter should be validated in caller.
r   Nrs   )rM   r   r   rh   _raise_invalid_indexerr   r3   _recognized_scalars)r9   r   r   r   r   r   loweruppers           r:   _maybe_cast_slice_bound-DatetimeIndexOpsMixin._maybe_cast_slice_bound  s    " eS!!A#44U;  88vFLE FN555E::#A#ABB''7  A ++GU@@	As   B   
B&
B!!B&c                    [         e)a  
Shift index by desired number of time frequency increments.

This method is for shifting the values of datetime-like indexes
by a specified time increment a given number of times.

Parameters
----------
periods : int, default 1
    Number of periods (or increments) to shift by,
    can be positive or negative.
freq : pandas.DateOffset, pandas.Timedelta or string, optional
    Frequency increment to shift by.
    If None, the index is shifted by its own `freq` attribute.
    Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

Returns
-------
pandas.DatetimeIndex
    Shifted index.

See Also
--------
Index.shift : Shift values of Index.
PeriodIndex.shift : Shift values of PeriodIndex.
r   )r9   periodsr?   s      r:   shiftDatetimeIndexOpsMixin.shift  s
    6 "!r<   c                     U R                   R                  USS9n[        X"R                  S9$ ! [        [        4 a2    [	        U[
        5      (       d  [        R                  " U5      n NPUn NTf = f)zD
Analogue to maybe_cast_indexer for get_indexer instead of get_loc.
T)allow_objectra   )
r3   _validate_listlikerh   ri   rM   r"   comasarray_tuplesafer%   ra   )r9   keyarrress      r:   _maybe_cast_listlike_indexer2DatetimeIndexOpsMixin._maybe_cast_listlike_indexer  sk    	**//T/JC S		** I& 	fn55++F3 	s   / ;A1,A10A1rQ   )r5   boolr6   z
int | None)returnzBaseOffset | None)r   None)r   znpt.NDArray[np.int64])r   r   )r   r   r   r   )rp   r   r   r   )r{   r   r   r   )r   	list[str]r   r   r   
str | Noner   r   rC   )r   r   r   r   )r   r   )r   r   r   ztuple[datetime, Resolution])r{   r   r   slice | npt.NDArray[np.intp])r   r   r   r*   r   r   )r   r      Nr   intr   r	   )%__name__
__module____qualname____firstlineno____doc___can_hold_strings__annotations__r8   propertyr?   setterrF   rL   r   r   rR   rU   rY   ru   r|   r   _default_na_repr   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__r   s   @r:   r1   r1   X   s    77%)a -9^  : 
[[      '& '&R 0  0% % ! !+Z'R= O LP
"
,/
>H
	
 ' ' , + +",) )6)6 )6 
&	)6 )6VH">+ +r<   r1   c                    ^  \ rS rSr% SrS\S'   SS/rSS/r\R                  r
\R                  r\R                  r\S#S j5       rS$S jrS	 r\S%S
 j5       rS&S'S jjr\S(S j5       r\S)S j5       rS*S jrS+S jrS+S jrS+S jrS,S-S jjrS rS.S jrS.S jrS/S0S jjr U 4S jr!S r"        S1U 4S jjr#S%S jr$S2S jr%S3S4U 4S jjjr&S5S jr'S6S jr(S+U 4S jjr)S6U 4S  jjr*   S7     S8S! jjr+S"r,U =r-$ )9DatetimeTimedeltaMixini'  zY
Mixin class for methods shared by DatetimeIndex and TimedeltaIndex,
but not PeriodIndex
zDatetimeArray | TimedeltaArrayr3   r   r?   c                .    U R                   R                  $ rC   )r3   unitr@   s    r:   r   DatetimeTimedeltaMixin.unit6  rH   r<   c                |    U R                   R                  U5      n[        U 5      R                  X R                  S9$ )a  
Convert to a dtype with the given unit resolution.

This method is for converting the dtype of a ``DatetimeIndex`` or
``TimedeltaIndex`` to a new dtype with the given unit
resolution/precision.

Parameters
----------
unit : {'s', 'ms', 'us', 'ns'}

Returns
-------
same type as self
    Converted to the specified unit.

See Also
--------
Timestamp.as_unit : Convert to the given unit.
Timedelta.as_unit : Convert to the given unit.
DatetimeIndex.as_unit : Convert to the given unit.
TimedeltaIndex.as_unit : Convert to the given unit.

Examples
--------
For :class:`pandas.DatetimeIndex`:

>>> idx = pd.DatetimeIndex(["2020-01-02 01:02:03.004005006"])
>>> idx
DatetimeIndex(['2020-01-02 01:02:03.004005006'],
              dtype='datetime64[ns]', freq=None)
>>> idx.as_unit("s")
DatetimeIndex(['2020-01-02 01:02:03'], dtype='datetime64[s]', freq=None)

For :class:`pandas.TimedeltaIndex`:

>>> tdelta_idx = pd.to_timedelta(["1 day 3 min 2 us 42 ns"])
>>> tdelta_idx
TimedeltaIndex(['1 days 00:03:00.000002042'],
                dtype='timedelta64[ns]', freq=None)
>>> tdelta_idx.as_unit("s")
TimedeltaIndex(['1 days 00:03:00'], dtype='timedelta64[s]', freq=None)
r   )r3   as_unitrc   _simple_newr   )r9   r   arrs      r:   r  DatetimeTimedeltaMixin.as_unit:  s5    X jj  &Dz%%c		%::r<   c                |    U R                   R                  U5      n[        U 5      R                  X R                  S9$ )Nr   )r3   
_with_freqrc   r  _name)r9   r?   r  s      r:   r  !DatetimeTimedeltaMixin._with_freqi  s2    jj##D)Dz%%c

%;;r<   c                t    U R                   R                  nUR                  5       nSUR                  l        U$ )NF)r3   r   ro   flags	writeable)r9   datas     r:   valuesDatetimeTimedeltaMixin.valuesm  s/     zz""yy{$

r<   c                   Ub7  X R                   :w  a(  [        U[        5      (       a  [        U5      nX-  nX-   $ US:X  d  [	        U 5      S:X  a  U R                  5       $ U R                   c  [        S5      eU S   XR                   -  -   nU S   XR                   -  -   nU R                  R                  XESU R                   U R                  S9n[        U 5      R                  X`R                  S9$ )a  
Shift index by desired number of time frequency increments.
This method is for shifting the values of datetime-like indexes
by a specified time increment a given number of times.

Parameters
----------
periods : int, default 1
    Number of periods (or increments) to shift by,
    can be positive or negative.
freq : pandas.DateOffset, pandas.Timedelta or string, optional
    Frequency increment to shift by.
    If None, the index is shifted by its own `freq` attribute.
    Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

Returns
-------
pandas.DatetimeIndex
    Shifted index.

See Also
--------
Index.shift : Shift values of Index.
PeriodIndex.shift : Shift values of PeriodIndex.
Nr   zCannot shift with no freqr   )startendr   r?   r   r   )r?   rM   r   r   r   copyr   r3   _generate_ranger   rc   r  r   )r9   r   r?   offsetr  r  r   s          r:   r   DatetimeTimedeltaMixin.shiftu  s    4 		 1$$$ ^F= a<3t9>99;99$%@AAQ'II--2h99,,
 ++$TYYTYY , 
 Dz%%f99%==r<   c                .    U R                   R                  $ )a  
Return the inferred frequency of the index.

Returns
-------
str or None
    A string representing a frequency generated by ``infer_freq``.
    Returns ``None`` if the frequency cannot be inferred.

See Also
--------
DatetimeIndex.freqstr : Return the frequency object as a string if it's set,
    otherwise ``None``.

Examples
--------
For ``DatetimeIndex``:

>>> idx = pd.DatetimeIndex(["2018-01-01", "2018-01-03", "2018-01-05"])
>>> idx.inferred_freq
'2D'

For ``TimedeltaIndex``:

>>> tdelta_idx = pd.to_timedelta(["0 days", "10 days", "20 days"])
>>> tdelta_idx
TimedeltaIndex(['0 days', '10 days', '20 days'],
               dtype='timedelta64[us]', freq=None)
>>> tdelta_idx.inferred_freq
'10D'
)r3   r   r@   s    r:   r   $DatetimeTimedeltaMixin.inferred_freq  s    B zz'''r<   c                    [        [        U R                  5      n[        U5      R	                  U R
                  5      R                  n[        U S   R                  U S   R                  U-   U5      n[        U5      $ Nr   r   )	r
   r   r?   r   r  r   _valueranger'   )r9   r?   tickrngs       r:   _as_range_index&DatetimeTimedeltaMixin._as_range_index  s_     D$))$&&tyy188DGNNDHOOd$:DA#r<   c                x    [        U R                  [        5      =(       a    [        UR                  [        5      $ rC   )rM   r?   r   r9   rp   s     r:   _can_range_setop'DatetimeTimedeltaMixin._can_range_setop  s#    $))T*Kz%**d/KKr<   c                   S n[        U5      (       d  U R                  nOU[        U[        5      (       a@  [	        [        UR                  U R                  S9R                  U R                  5      5      nUR                  R                  U R                  R                  R                  5      n[        U R                  5      R                  UU R                  US9n[!        SU R#                  X5      5      $ )N)r   )ra   r?   r	   )r   r?   rM   r'   r   r   stepr   r  r  ro   r3   r   ra   rc   r  r
   _wrap_setop_result)r9   rp   res_i8new_freq
res_valuesr   s         r:   _wrap_range_setop(DatetimeTimedeltaMixin._wrap_range_setop  s    6{{yyH
++ &++DII6>>tyyIH ]]''

(;(;(A(AB
djj!-- ** . 
 FD33EBCCr<   c                r    U R                   nUR                   nUR                  XBS9nU R                  X5      $ Nsort)r  intersectionr+  r9   rp   r0  rs   rt   r(  s         r:   _range_intersect'DatetimeTimedeltaMixin._range_intersect  s<    ##%%""5"4%%e44r<   c                r    U R                   nUR                   nUR                  XBS9nU R                  X5      $ r.  )r  unionr+  r2  s         r:   _range_union#DatetimeTimedeltaMixin._range_union  s9    ##%%E-%%e44r<   c                >   [        SU5      nU R                  U5      (       a  U R                  XS9$ U R                  U5      (       dF  [        R
                  " XUS9nU R                  X5      nUR                  S5      R                  S5      $ U R                  X5      $ )zO
intersection specialized to the case with matching dtypes and both non-empty.
r   r/  Ninfer)	r
   r#  r3  _can_fast_intersectr%   _intersectionr'  r  _fast_intersect)r9   rp   r0  r   s       r:   r<  $DatetimeTimedeltaMixin._intersection  s     -u5  ''(((::''..((4@F ,,U;F$$T*55g>> ''44r<   c                    U S   US   ::  a  XpCOXpC[        US   US   5      nUS   nXV:  a  U S S nU$ [        UR                  Xe5      6 nUR                  U   nU$ r  )minr   
slice_locs_values)	r9   rp   r0  rs   rt   r  r  r   lslices	            r:   r=  &DatetimeTimedeltaMixin._fast_intersect  sz    7eAh%% $r(E"I&a;"1XF
  DOOE78F\\&)Fr<   c                    U R                   c  gUR                   U R                   :w  a  gU R                  (       d  gU R                   R                  S:H  $ )NFr   )r?   r   nr"  s     r:   r;  *DatetimeTimedeltaMixin._can_fast_intersect,  sC    99ZZ499$-- yy{{ar<   c                    U R                   nUb  X!R                   :w  a  gU R                  (       d  g[        U 5      S:X  d  [        U5      S:X  a  gU S   US   ::  a  XpCOXpCUS   nUS   nXVU-   :H  =(       d    XS;   $ )NFr   Tr   )r?   r   r   )r9   rp   r?   rs   rt   right_startleft_ends          r:   _can_fast_union&DatetimeTimedeltaMixin._can_fast_union>  s     yy<4::-++ t9>SZ1_ 7eAh%%Ah8 $.F;3FFr<   c                :   U S   US   ::  a  XpCOhUSL aa  XpCUS   nUR                  USS9nUR                  S U n[        UR                  U45      n[        U 5      R	                  XR
                  S9n	U	$ XpCUS   n
US   nX:  a  UR                  U
SS9nUR                  US  n[        UR                  U/5      n[        U[        U R                  5      5      (       d   eUR                  U R                  :X  d   e[        U 5      R	                  U5      n	U	$ U$ )Nr   Frs   r   r   r   rt   )
r   rB  r   rc   r  r   rM   r3   _freqr?   )r9   rp   r0  rs   rt   
left_startlocright_chunkdatesr   rJ  	right_ends               r:   _fast_union"DatetimeTimedeltaMixin._fast_union\  s3    7eAh%U] %aJ$$Zf$=C---K!4<<"=>E$Z++E		+BFM%8"I	 $$XG$<C---K!4<<"=>E eT$**%56666 ;;$))+++$Z++E2FMKr<   c                H  > [        U[        U 5      5      (       d   eU R                  UR                  :X  d   eU R                  U5      (       a  U R	                  XS9$ U R                  U5      (       a  U R                  XS9nU$ [        TU ]!  X5      R                  S5      $ )Nr/  r:  )
rM   rc   ra   r#  r7  rK  rT  r   _unionr  )r9   rp   r0  r   r   s       r:   rW  DatetimeTimedeltaMixin._union  s    %d,,,,zzU[[(((  ''$$U$66&&%%e%7F M7>%.99'BBr<   c                N    SnU R                  U5      (       a  U R                  nU$ )z;
Get the freq to attach to the result of a join operation.
N)rK  r?   )r9   rp   r?   s      r:   _get_join_freq%DatetimeTimedeltaMixin._get_join_freq  s(     &&99Dr<   c                   > UR                   U R                   :X  d   UR                   U R                   45       e[        TU ]	  XX4U5      u  pcnU R                  U5      UR                  l        XcU4$ rC   )ra   r   _wrap_join_resultrZ  r3   rN  )r9   joinedrp   lidxridxhow
join_indexr   s          r:   r]  (DatetimeTimedeltaMixin._wrap_join_result  sn     {{djj(C5;;

*CC(!&!:4s"

$ "&!4!4U!;
%%r<   c                L    U R                   R                  R                  S5      $ )Nr_   )r3   r   ro   r@   s    r:   _get_engine_target)DatetimeTimedeltaMixin._get_engine_target  s    zz""''--r<   c                    UR                  U R                  R                  R                  5      nU R                  R	                  U5      $ rC   )ro   r3   r   ra   _from_backing_data)r9   r   s     r:   _from_join_target(DatetimeTimedeltaMixin._from_join_target  s5    TZZ00667zz,,V44r<   c                ~  > U R                   (       a  [        U[        [        45      (       a  [	        UR
                  5      [	        U R
                  5      :  aV  US:X  a  UR                  U R
                  5      nO4UR                  U R
                  5      R                  U R
                  5      n[        TU ]%  X5      $ )Nrt   )
r   rM   r   r   r   r   r  ceilr   _searchsorted_monotonic)r9   r   r   r   s      r:   rm  .DatetimeTimedeltaMixin._searchsorted_monotonic  s    ((59i"899"5::.1CDII1NN wdii0 

499-55dii@w.u;;r<   c                   SnU R                   b  [        U5      (       a.  US[        U 5      * S[        U 5      S-
  4;   a  U R                   nU$ [        U5      (       aA  [        R
                  " [        R                  " U[        R                  S9[        U 5      5      n[        U[        5      (       aG  UR                  S;   a7  UR                  S;   d  UR                  [        U 5      S4;   a  U R                   nU$ )z'
Find the `freq` for self.delete(loc).
Nr   r   r   r   r   )r   N)r?   r   r   r   r   maybe_indices_to_slicerk   r   intprM   r   r&  r  stop)r9   rP  r?   s      r:   _get_delete_freq'DatetimeTimedeltaMixin._get_delete_freq  s     99 #1s4yj"c$i!m<<99D   $$ 44

3bgg6D	C c5))chh).CyyI-c$i=N1N#yyr<   c                J   U R                   R                  U5      nU R                   R                  U5      nSnU R                  b  U R                  (       as  U[
        L a   U$ US[        U 5      * 4;   a#  X R                  -   U S   :X  a  U R                  nU$ U[        U 5      :X  a!  X R                  -
  U S   :X  a  U R                  nU$ [        U R                  [        5      (       a  U R                  nU$ U R                  R                  U5      (       a  U R                  nU$ )z-
Find the `freq` for self.insert(loc, item).
Nr   r   )
r3   _validate_scalar	_box_funcr?   sizer   r   rM   r   is_on_offset)r9   rP  itemrD   r?   s        r:   _get_insert_freq'DatetimeTimedeltaMixin._get_insert_freq  s    

++D1zz##E*99 yy3;  QT
O+yy0@DG0K99D  SY&D99,<R,H99D  DIIt,, yy  ''--yyr<   c                f   > [         TU ]  U5      nU R                  U5      UR                  l        U$ )aA  
Make new Index with passed location(-s) deleted.

Parameters
----------
loc : int or list of int
    Location of item(-s) which will be deleted.
    Use a list of locations to delete more than one value at the same time.

Returns
-------
Index
    Will be same type as self, except for RangeIndex.

See Also
--------
numpy.delete : Delete any rows and column from NumPy array (ndarray).

Examples
--------
>>> idx = pd.Index(["a", "b", "c"])
>>> idx.delete(1)
Index(['a', 'c'], dtype='str')
>>> idx = pd.Index(["a", "b", "c"])
>>> idx.delete([0, 2])
Index(['b'], dtype='str')
)r   deleters  r3   rN  )r9   rP  r   r   s      r:   r~  DatetimeTimedeltaMixin.delete  s/    8 $!2237r<   c                   > [         TU ]  X5      n[        U[        U 5      5      (       a   U R	                  X5      UR
                  l        U$ )ae  
Make new Index inserting new item at location.
Follows Python numpy.insert semantics for negative values.

Parameters
----------
loc : int
    The integer location where the new item will be inserted.
item : object
    The new item to be inserted into the Index.

Returns
-------
Index
    Returns a new Index object resulting from inserting the specified item at
    the specified location within the original Index.

See Also
--------
Index.append : Append a collection of Indexes together.

Examples
--------
>>> idx = pd.Index(["a", "b", "c"])
>>> idx.insert(1, "x")
Index(['a', 'x', 'b', 'c'], dtype='str')
)r   insertrM   rc   r{  r3   rN  )r9   rP  rz  r   r   s       r:   r  DatetimeTimedeltaMixin.insert  s@    8 *fd4j))!%!6!6s!AFLLr<   c                l   [         R                  " SU5        [        R                  " U[        R                  S9n[
        R                  " XX#U40 UD6n[        R                  " U[        U 5      5      n[        U[        5      (       a+  U R                  R                  U5      nXR                  l        U$ )a  
Return a new Index of the values selected by the indices.
For internal compatibility with numpy arrays.

Parameters
----------
indices : array-like
    Indices to be taken.
axis : {0 or 'index'}, optional
    The axis over which to select values, always 0 or 'index'.
allow_fill : bool, default True
    How to handle negative values in `indices`.
    * False: negative values in `indices` indicate positional indices
        from the right (the default). This is similar to
        :func:`numpy.take`.
    * True: negative values in `indices` indicate
        missing values. These values are set to `fill_value`. Any other
        other negative values raise a ``ValueError``.
fill_value : scalar, default None
    If allow_fill=True and fill_value is not None, indices specified by
    -1 are regarded as NA. If Index doesn't hold NA, raise ValueError.
**kwargs
    Required for compatibility with numpy.

Returns
-------
Index
    An index formed of elements at the given indices. Will be the same
    type as self, except for RangeIndex.

See Also
--------
numpy.ndarray.take: Return an array formed from the
    elements of a at the given indices.

Examples
--------
>>> idx = pd.Index(["a", "b", "c"])
>>> idx.take([2, 2, 1, 2])
Index(['c', 'c', 'b', 'c'], dtype='str')
rQ   r   )nvvalidate_takerk   r   rq  r&   taker   rp  r   rM   r   r3   _get_getitem_freqrN  )	r9   indicesr6   
allow_fill
fill_valuekwargsr   maybe_slicer?   s	            r:   r  DatetimeTimedeltaMixin.take>  s    b 	V$**WBGG4,114Z
;A
 00#d)Dk5)):://<D!%LLr<   rQ   )r   r-   )r   r-   r   r	   )r   
np.ndarrayr   r   )r   r   )r   r'   r   )r   r	   )F)rp   r%   r0  r   r   r%   )rp   r	   r   r   rC   )rp   r	   r   r	   )r_  npt.NDArray[np.intp] | Noner`  r  ra  r,   r   zEtuple[Self, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None])r   r  )rs   )r   zLiteral['left', 'right'])rP  zint | slice | Sequence[int])rP  r   )r   TN)r6   r+   r  r   r   r	   ).r   r   r   r   r   r   _comparablesr   r%   r   _is_monotonic_increasingis_monotonic_decreasing_is_monotonic_decreasing	is_unique
_is_uniquer   r   r  r  r  r   r   r   r  r#  r+  r3  r7  r<  r=  r;  rK  rT  rW  rZ  r]  re  ri  rm  rs  r{  r~  r  r  r   r   r   s   @r:   r   r   '  sn   
 *)F#L6"K  %<<$<<J -;^<  0>d  (  (J  LD4555.( $G<$LC&& *	&
 *& & 
O&.5
< <&,4@ P < < 	< 
< <r<   r   )Pr   
__future__r   abcr   r   typingr   r   r   r	   r
   r   numpyrk   pandas._libsr   r   pandas._libs.tslibsr   r   r   r   r   r   r   pandas._libs.tslibs.dtypesr   pandas.compat.numpyr   r  pandas.errorsr   r   r   r   pandas.util._decoratorsr   pandas.core.dtypes.commonr   r   pandas.core.dtypes.concatr   pandas.core.dtypes.dtypesr   r    pandas.core.arraysr!   r"   r#   r$   pandas.core.commoncorecommonr   pandas.core.indexes.baseindexesbaseibaser%   pandas.core.indexes.extensionr&   pandas.core.indexes.ranger'   pandas.core.tools.timedeltasr(   collections.abcr)   r*   pandas._typingr+   r,   r-   r.   rK   r/   dict_index_doc_kwargsr1   r   rQ   r<   r:   <module>r     s    #     : .  4
  !   ( ( F 0 5(!  (001 L+7 L+^S	2C S	r<   