Ë
    u™ãj”  ã                  óÜ  — d Z ddlmZ ddlZddlmZmZmZ ddlZddl	m
ZmZ ddl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 dd
lmZmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'c m(Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1 er.ddl2m3Z3 ddlm4Z4 ddl5Z6ddl	m7Z7 ddl8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z? ddl@mAZA d„ ZB ed«       G d„ de.«      «       ZC ed«      	 	 	 	 	 	 dddœ	 	 	 	 	 dd„«       ZDy)zimplement the TimedeltaIndexé    )ÚannotationsN)ÚTYPE_CHECKINGÚSelfÚcast)ÚindexÚlib)ÚDayÚ
ResolutionÚTickÚ	TimedeltaÚ	TimestampÚ	timezonesÚ	to_offset)Úabbrev_to_npy_unit)Úparse_timedelta_string_reso)Ú
set_module)Ú	is_scalarÚpandas_dtype)Ú
ArrowDtype)Ú	ABCSeries)Úisna)ÚTimedeltaArray)ÚIndexÚmaybe_extract_name)ÚDatetimeTimedeltaMixin)ÚrmulÚrsub)ÚCallable)ÚAny)ÚNaTType)ÚAxisIntÚDtypeObjÚNpDtypeÚTimeAmbiguousÚTimeNonexistentÚTimeUnitÚnpt)Ú	DataFramec                óô  — d|v r¡t        |d   t        «      sŽ|j                  d«      }t        |t        «      r|}n!t        j                  ||j
                  ¬«      }t        |«      j                  dd«      }|j                  d|«      } | j                  |fi |¤Ž}||_        |S t        j                  «       5  t        j                  d«        | j                  | fi |¤Ž}ddd«       |S # 1 sw Y   S xY w)zu
    This is called upon unpickling, rather than the default which doesn't
    have arguments and breaks __new__
    Údata)ÚdtypeÚ_freqNÚfreqÚignore)Ú
isinstanceÚTimedeltaIndexÚpopr   Ú_simple_newr+   Úvarsr,   ÚwarningsÚcatch_warningsÚsimplefilterÚ__new__)ÚclsÚdr*   ÚtdarrÚlegacy_freqr-   Úresults          úi/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/core/indexes/timedeltas.pyÚ_new_TimedeltaIndexr>   F   sâ   € ð
 ��{œ: a¨¡i´Ô@Ø�u‰u�V‹}ˆÜ�dœNÔ+Ø‰Eä"×.Ñ.¨t¸4¿:¹:ÔFˆEô ˜5“k—o‘o g¨tÓ4ˆØ�u‰u�V˜[Ó)ˆØ �—‘ Ñ,¨!Ñ,ˆØˆŒð
 €Mô ×$Ñ$Ó&ñ 	+Ü×!Ñ! (Ô+Ø �S—[‘[ Ñ*¨Ñ*ˆF÷	+ð €M÷	+ð €Mús   Â:)C-Ã-C7Úpandasc                  ó(  ‡ — e Zd ZU dZdZeZed)d„«       Zde	d<   e
j                  Zd*d„Zd+d„Zd,d„Z	 	 d-	 	 	 	 	 d.d	„Z	 	 d-	 	 	 	 	 d.d
„Z	 	 d-	 	 	 	 	 d.d„Zed,d„«       Zed,d„«       Zed,d„«       Zed,d„«       Zed/d„«       Zd0d„Zddddddddœ	 	 	 	 	 	 	 	 	 	 	 d1d„Zdddddddœ	 	 	 	 	 	 	 	 	 	 	 d2d„Zdddœ	 	 	 	 	 d3d„Zdej8                  dddf	 d4d„Zd„ Zd5d„Zd6d „Z d6d!„Z!d7ˆ fd"„Z"	 	 	 	 	 	 d8d#„Z#d9d$„Z$d%„ Z%d:d&„Z&d;d'„Z'ed<d(„«       Z(ˆ xZ)S )=r0   a 	  
    Immutable Index of timedelta64 data.

    Represented internally as int64, and scalars returned Timedelta objects.

    Parameters
    ----------
    data : array-like (1-dimensional), optional
        Optional timedelta-like data to construct index with.
    freq : str or pandas offset object, optional
        One of pandas date offset strings or corresponding objects. The string
        ``'infer'`` can be passed in order to set the frequency of the index as
        the inferred frequency upon creation.
    dtype : numpy.dtype or str, default None
        Valid ``numpy`` dtypes are ``timedelta64[ns]``, ``timedelta64[us]``,
        ``timedelta64[ms]``, and ``timedelta64[s]``.
    copy : bool, default None
        Whether to copy input data, only relevant for array, Series, and Index
        inputs (for other input, e.g. a list, a new array is created anyway).
        Defaults to True for array input and False for Index/Series.
        Set to False to avoid copying array input at your own risk (if you
        know the input data won't be modified elsewhere).
        Set to True to force copying Series/Index input up front.
    name : object
        Name to be stored in the index.

    Attributes
    ----------
    days
    seconds
    microseconds
    nanoseconds
    components
    inferred_freq

    Methods
    -------
    to_pytimedelta
    to_series
    round
    floor
    ceil
    to_frame
    mean

    See Also
    --------
    Index : The base pandas Index type.
    Timedelta : Represents a duration between two dates or times.
    DatetimeIndex : Index of datetime64 data.
    PeriodIndex : Index of Period data.
    timedelta_range : Create a fixed-frequency TimedeltaIndex.

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

    Examples
    --------
    >>> pd.TimedeltaIndex(["0 days", "1 days", "2 days", "3 days", "4 days"])
    TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'],
                   dtype='timedelta64[us]', freq=None)

    We can also let pandas infer the frequency when possible.

    >>> pd.TimedeltaIndex(np.arange(5) * 24 * 3600 * 1e9, freq="infer")
    TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'],
                   dtype='timedelta64[ns]', freq='D')
    Útimedeltaindexc                ó"   — t         j                  S ©N)ÚlibindexÚTimedeltaEngine©Úselfs    r=   Ú_engine_typezTimedeltaIndex._engine_type«   s   € ä×'Ñ'Ð'ó    r   Ú_datac                óH   — t        || j                  |j                  d¬«      S )z@Wrap an ndarray result computed from ``self._data`` in an Index.F)Únamer+   Úcopy)r   rL   r+   ©rG   r<   s     r=   Ú_wrap_field_resultz!TimedeltaIndex._wrap_field_result·   s   € ä�V $§)¡)°6·<±<ÀeÔLÐLrI   c                óN   — t        | «      j                  || j                  ¬«      S )z:Wrap a TimedeltaArray result computed from ``self._data``.©rL   )Útyper2   rL   rN   s     r=   Ú_wrap_td_resultzTimedeltaIndex._wrap_td_result»   s    € ä�D‹z×%Ñ% f°4·9±9Ð%Ó=Ð=rI   c                óT   — | j                  | j                  j                  «       «      S )a�  
        Return total duration of each element expressed in seconds.

        This method is available directly on TimedeltaArray, TimedeltaIndex
        and on Series containing timedelta values under the ``.dt`` namespace.

        Returns
        -------
        Index
            An Index with a float64 dtype.

        See Also
        --------
        datetime.timedelta.total_seconds : Standard library version
            of this method.
        TimedeltaIndex.components : Return a DataFrame with components of
            each Timedelta.

        Examples
        --------
        >>> idx = pd.to_timedelta(np.arange(5), unit="D")
        >>> idx
        TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'],
                       dtype='timedelta64[us]', freq=None)

        >>> idx.total_seconds()
        Index([0.0, 86400.0, 172800.0, 259200.0, 345600.0], dtype='float64')
        )rO   rJ   Útotal_secondsrF   s    r=   rU   zTimedeltaIndex.total_seconds¿   s"   € ð: ×&Ñ& t§z¡z×'?Ñ'?Ó'AÓBÐBrI   c                óZ   — | j                  | j                  j                  |||«      «      S )a�  
        Perform round operation on the data to the specified `freq`.

        This method rounds each timedelta value in the Series/Index to the
        nearest specified frequency using standard rounding rules (round half
        to even).

        Parameters
        ----------
        freq : str or Offset
            The frequency level to round the index to. Must be a fixed
            frequency like 's' (second) not 'ME' (month end). See
            :ref:`frequency aliases <timeseries.offset_aliases>` for
            a list of possible `freq` values.
        ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.round`;
            has no effect since TimedeltaIndex values are never tz-aware.
        nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta,             default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.round`;
            has no effect since TimedeltaIndex values are never tz-aware.

        Returns
        -------
        TimedeltaIndex
            Values rounded to the given `freq`.

        Raises
        ------
        ValueError if the `freq` cannot be converted.

        See Also
        --------
        TimedeltaIndex.floor : Perform floor operation on the data to the
            specified `freq`.
        TimedeltaIndex.ceil : Perform ceil operation on the data to the
            specified `freq`.

        Examples
        --------
        >>> tdelta_idx = pd.timedelta_range("1 day", periods=3, freq="6h20min")
        >>> tdelta_idx
        TimedeltaIndex(['1 days 00:00:00', '1 days 06:20:00', '1 days 12:40:00'],
                       dtype='timedelta64[us]', freq='380min')
        >>> tdelta_idx.round("h")
        TimedeltaIndex(['1 days 00:00:00', '1 days 06:00:00', '1 days 13:00:00'],
                       dtype='timedelta64[us]', freq=None)
        )rS   rJ   Úround©rG   r-   Ú	ambiguousÚnonexistents       r=   rW   zTimedeltaIndex.roundá   s)   € ðl ×#Ñ# D§J¡J×$4Ñ$4°T¸9ÀkÓ$RÓSÐSrI   c                óZ   — | j                  | j                  j                  |||«      «      S )aj  
        Perform floor operation on the data to the specified `freq`.

        This method rounds each timedelta value in the Series/Index down to
        the specified frequency (i.e., towards negative infinity).

        Parameters
        ----------
        freq : str or Offset
            The frequency level to floor the index to. Must be a fixed
            frequency like 's' (second) not 'ME' (month end). See
            :ref:`frequency aliases <timeseries.offset_aliases>` for
            a list of possible `freq` values.
        ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.floor`;
            has no effect since TimedeltaIndex values are never tz-aware.
        nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta,             default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.floor`;
            has no effect since TimedeltaIndex values are never tz-aware.

        Returns
        -------
        TimedeltaIndex
            Values rounded down to the given `freq`.

        Raises
        ------
        ValueError if the `freq` cannot be converted.

        See Also
        --------
        TimedeltaIndex.round : Perform round operation on the data to the
            specified `freq`.
        TimedeltaIndex.ceil : Perform ceil operation on the data to the
            specified `freq`.

        Examples
        --------
        >>> tdelta_idx = pd.timedelta_range("1 day", periods=3, freq="6h20min")
        >>> tdelta_idx
        TimedeltaIndex(['1 days 00:00:00', '1 days 06:20:00', '1 days 12:40:00'],
                       dtype='timedelta64[us]', freq='380min')
        >>> tdelta_idx.floor("h")
        TimedeltaIndex(['1 days 00:00:00', '1 days 06:00:00', '1 days 12:00:00'],
                       dtype='timedelta64[us]', freq=None)
        )rS   rJ   ÚfloorrX   s       r=   r\   zTimedeltaIndex.floor  s)   € ðj ×#Ñ# D§J¡J×$4Ñ$4°T¸9ÀkÓ$RÓSÐSrI   c                óZ   — | j                  | j                  j                  |||«      «      S )ac  
        Perform ceil operation on the data to the specified `freq`.

        This method rounds each timedelta value in the Series/Index up to
        the specified frequency (i.e., towards positive infinity).

        Parameters
        ----------
        freq : str or Offset
            The frequency level to ceil the index to. Must be a fixed
            frequency like 's' (second) not 'ME' (month end). See
            :ref:`frequency aliases <timeseries.offset_aliases>` for
            a list of possible `freq` values.
        ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.ceil`;
            has no effect since TimedeltaIndex values are never tz-aware.
        nonexistent : 'shift_forward', 'shift_backward', 'NaT', timedelta,             default 'raise'
            Accepted for compatibility with :meth:`DatetimeIndex.ceil`;
            has no effect since TimedeltaIndex values are never tz-aware.

        Returns
        -------
        TimedeltaIndex
            Values rounded up to the given `freq`.

        Raises
        ------
        ValueError if the `freq` cannot be converted.

        See Also
        --------
        TimedeltaIndex.round : Perform round operation on the data to the
            specified `freq`.
        TimedeltaIndex.floor : Perform floor operation on the data to the
            specified `freq`.

        Examples
        --------
        >>> tdelta_idx = pd.timedelta_range("1 day", periods=3, freq="6h20min")
        >>> tdelta_idx
        TimedeltaIndex(['1 days 00:00:00', '1 days 06:20:00', '1 days 12:40:00'],
                       dtype='timedelta64[us]', freq='380min')
        >>> tdelta_idx.ceil("h")
        TimedeltaIndex(['1 days 00:00:00', '1 days 07:00:00', '1 days 13:00:00'],
                       dtype='timedelta64[us]', freq=None)
        )rS   rJ   ÚceilrX   s       r=   r^   zTimedeltaIndex.ceilP  s'   € ðj ×#Ñ# D§J¡J§O¡O°D¸)À[Ó$QÓRÐRrI   c                óL   — | j                  | j                  j                  «      S )a:  
        Number of days for each element.

        This attribute returns the number of whole days in each timedelta value.
        It represents the days component of the duration, not the total duration
        expressed in days.

        See Also
        --------
        Series.dt.seconds : Return number of seconds for each element.
        Series.dt.microseconds : Return number of microseconds for each element.
        Series.dt.nanoseconds : Return number of nanoseconds for each element.

        Examples
        --------
        >>> 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.days
        Index([0, 10, 20], dtype='int64')
        )rO   rJ   ÚdaysrF   s    r=   r`   zTimedeltaIndex.days‡  s   € ð0 ×&Ñ& t§z¡z§¡Ó7Ð7rI   c                óL   — | j                  | j                  j                  «      S )a  
        Number of seconds (>= 0 and less than 1 day) for each element.

        This attribute returns the seconds component of each timedelta value,
        which is the number of seconds remaining after subtracting whole days.
        Values range from 0 to 86399.

        See Also
        --------
        Series.dt.seconds : Return number of seconds for each element.
        Series.dt.nanoseconds : Return number of nanoseconds for each element.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="s")
        >>> tdelta_idx
        TimedeltaIndex(['0 days 00:00:01', '0 days 00:00:02', '0 days 00:00:03'],
                       dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.seconds
        Index([1, 2, 3], dtype='int32')
        )rO   rJ   ÚsecondsrF   s    r=   rb   zTimedeltaIndex.seconds¡  s   € ð. ×&Ñ& t§z¡z×'9Ñ'9Ó:Ð:rI   c                óL   — | j                  | j                  j                  «      S )a/  
        Number of microseconds (>= 0 and less than 1 second) for each element.

        This attribute returns the microseconds component of each timedelta value,
        which is the number of microseconds remaining after subtracting whole
        seconds. Values range from 0 to 999999.

        See Also
        --------
        Timedelta.microseconds : Number of microseconds (>= 0 and less than
            1 second).

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="us")
        >>> tdelta_idx
        TimedeltaIndex(['0 days 00:00:00.000001', '0 days 00:00:00.000002',
                        '0 days 00:00:00.000003'],
                       dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.microseconds
        Index([1, 2, 3], dtype='int32')
        )rO   rJ   ÚmicrosecondsrF   s    r=   rd   zTimedeltaIndex.microsecondsº  s   € ð0 ×&Ñ& t§z¡z×'>Ñ'>Ó?Ð?rI   c                óL   — | j                  | j                  j                  «      S )ap  
        Number of nanoseconds (>= 0 and less than 1 microsecond) for each element.

        This attribute returns the nanoseconds component of each timedelta value,
        which is the number of nanoseconds remaining after subtracting whole
        microseconds. Values range from 0 to 999.

        See Also
        --------
        Series.dt.seconds : Return number of seconds for each element.
        Series.dt.microseconds : Return number of microseconds for each element.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="ns")
        >>> tdelta_idx
        TimedeltaIndex(['0 days 00:00:00.000000001', '0 days 00:00:00.000000002',
                        '0 days 00:00:00.000000003'],
                       dtype='timedelta64[ns]', freq=None)
        >>> tdelta_idx.nanoseconds
        Index([1, 2, 3], dtype='int32')
        )rO   rJ   ÚnanosecondsrF   s    r=   rf   zTimedeltaIndex.nanosecondsÔ  s   € ð0 ×&Ñ& t§z¡z×'=Ñ'=Ó>Ð>rI   c                ó.   — | j                   j                  S )a´  
        Return a DataFrame of the individual resolution components of the Timedeltas.

        The components (days, hours, minutes seconds, milliseconds, microseconds,
        nanoseconds) are returned as columns in a DataFrame.

        Returns
        -------
        DataFrame

        See Also
        --------
        TimedeltaIndex.total_seconds : Return total duration expressed in seconds.
        Timedelta.components : Return a components namedtuple-like of a single
            timedelta.

        Examples
        --------
        >>> 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.components
           days  hours  minutes  seconds  milliseconds  microseconds  nanoseconds
        0     1      0        3        0             0             2           42
        )rJ   Ú
componentsrF   s    r=   rh   zTimedeltaIndex.componentsî  s   € ð8 �z‰z×$Ñ$Ð$rI   c                ó6   — | j                   j                  «       S )a-  
        Return an ndarray of datetime.timedelta objects.

        Each element of the :class:`TimedeltaIndex` is converted to the
        corresponding native Python :class:`datetime.timedelta` object.

        Returns
        -------
        numpy.ndarray
            Object-dtype array of :class:`datetime.timedelta`.

        See Also
        --------
        to_timedelta : Convert argument to timedelta format.
        Timedelta : Represents a duration between two dates or times.
        DatetimeIndex: Index of datetime64 data.
        Timedelta.components : Return a components namedtuple-like
                               of a single timedelta.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="D")
        >>> tdelta_idx
        TimedeltaIndex(['1 days', '2 days', '3 days'],
                        dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.to_pytimedelta()
        array([datetime.timedelta(days=1), datetime.timedelta(days=2),
               datetime.timedelta(days=3)], dtype=object)
        )rJ   Úto_pytimedeltarF   s    r=   rj   zTimedeltaIndex.to_pytimedelta  s   € ð< �z‰z×(Ñ(Ó*Ð*rI   NFTr   ©Úaxisr+   ÚoutÚkeepdimsÚinitialÚskipnaÚ	min_countc          	     óF   — | j                   j                  |||||||¬«      S )a	  
        Return the sum of the values over the requested axis.

        Parameters
        ----------
        axis : int, optional
            Axis for the function to be applied on.
        dtype, out, keepdims, initial
            Not implemented; kept for compatibility with :func:`numpy.sum`,
            which calls this method when ``numpy.sum(tdi)`` is used. Must be
            left at their default values.
        skipna : bool, default True
            Whether to ignore any NaT elements.
        min_count : int, default 0
            The required number of valid values to perform the operation. If fewer
            than ``min_count`` non-NaT values are present the result is NaT.

        Returns
        -------
        Timedelta
            The sum, or NaT if it cannot be computed.

        See Also
        --------
        numpy.ndarray.sum : Returns the sum of array elements along a given axis.
        Series.sum : Return the sum of the values in a Series.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="D")
        >>> tdelta_idx
        TimedeltaIndex(['1 days', '2 days', '3 days'],
                        dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.sum()
        Timedelta('6 days 00:00:00')
        rk   )rJ   Úsum)rG   rl   r+   rm   rn   ro   rp   rq   s           r=   rs   zTimedeltaIndex.sum,  s4   € ð^ �z‰z�~‰~ØØØØØØØð ó 
ð 	
rI   é   ©rl   r+   rm   Úddofrn   rp   c               óD   — | j                   j                  ||||||¬«      S )a3  
        Return the standard deviation of the values over the requested axis.

        Parameters
        ----------
        axis : int, optional
            Axis for the function to be applied on.
        dtype, out, keepdims
            Not implemented; kept for compatibility with :func:`numpy.std`,
            which calls this method when ``numpy.std(tdi)`` is used. Must be
            left at their default values.
        ddof : int, default 1
            Delta degrees of freedom. The divisor used in calculations is
            ``N - ddof``, where ``N`` represents the number of elements.
        skipna : bool, default True
            Whether to ignore any NaT elements.

        Returns
        -------
        Timedelta
            The standard deviation, or NaT if it cannot be computed.

        See Also
        --------
        numpy.ndarray.std : Returns the standard deviation of array elements
            along a given axis.
        Series.std : Return sample standard deviation over requested axis.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="D")
        >>> tdelta_idx
        TimedeltaIndex(['1 days', '2 days', '3 days'],
                        dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.std()
        Timedelta('1 days 00:00:00')
        ru   )rJ   Ústd)rG   rl   r+   rm   rv   rn   rp   s          r=   rx   zTimedeltaIndex.stde  s-   € ð^ �z‰z�~‰~Ø˜U¨°$ÀÐRXð ó 
ð 	
rI   ©rl   rp   c               ó@   —  | j                   j                  d||dœ|¤ŽS )aÞ  
        Return the median of the values over the requested axis.

        Parameters
        ----------
        axis : int, optional
            Axis for the function to be applied on.
        skipna : bool, default True
            Whether to ignore any NaT elements.
        **kwargs
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Timedelta
            The median, or NaT if it cannot be computed.

        See Also
        --------
        numpy.median : Compute the median along the specified axis.
        Series.median : Return the median of the values in a Series.

        Examples
        --------
        >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit="D")
        >>> tdelta_idx
        TimedeltaIndex(['1 days', '2 days', '3 days'],
                        dtype='timedelta64[us]', freq=None)
        >>> tdelta_idx.median()
        Timedelta('2 days 00:00:00')
        ry   © )rJ   Úmedian)rG   rl   rp   Úkwargss       r=   r|   zTimedeltaIndex.median˜  s&   € ðN !ˆt�z‰z× Ñ ÐD d°6ÑD¸VÑDÐDrI   c                ó   — t        ||| «      }| j                  |||«      \  }}t        |«      r| j                  |«       |�t	        |«      }t        |t        «      rH|t        j                  u r6|�||j                  k(  r%|r|j                  «       }| j                  ||¬«      S t        |t        «      rG|t        j                  u r5|€3|�||j                  k(  r"|r|j                  «       S |j                  «       S t        |t        «      r|j                  nd }t        j                  |||¬«      }d }|s"t        |t         t"        f«      r|j$                  }| j                  |||¬«      }	|	j'                  ||«       |	S )NrQ   )r+   rM   )rL   Úrefs)r   Ú_maybe_copy_array_inputr   Ú_raise_scalar_data_errorr   r/   r   r   Ú
no_defaultr+   rM   r2   r0   Ú_viewr-   Ú_from_sequencer   r   Ú_referencesÚ	_pin_freq)
r8   r*   r-   r+   rM   rL   Úinferred_freqr:   r   r<   s
             r=   r7   zTimedeltaIndex.__new__Ä  sV  € ô " $¨¨cÓ2ˆð ×0Ñ0°°t¸UÓC‰
ˆˆdä�TŒ?Ø×(Ñ(¨Ô.àÐÜ  Ó'ˆEô �tœ^Ô,ØœŸ™Ñ&Ø� %¨4¯:©:Ò"5áØ—y‘y“{�Ø—?‘? 4¨d�?Ó3Ð3ô �tœ^Ô,ØœŸ™Ñ&Ø�Ø� %¨4¯:©:Ò"5áØ—y‘y“{Ð"à—z‘z“|Ð#ô &0°´nÔ%E˜Ÿ	š	È4ˆä×-Ñ-¨d¸%ÀdÔKˆØˆÙœ
 4¬)´UÐ);Ô<Ø×#Ñ#ˆDà—‘ ¨T¸�Ó=ˆØ×Ñ˜˜}Ô-ØˆrI   c                ór   — | j                   | j                  | j                  dœ}t        t	        | «      |fd fS )N)r*   rL   r-   )rJ   rL   r,   r>   rR   )rG   r9   s     r=   Ú
__reduce__zTimedeltaIndex.__reduce__ø  s/   € Ø—Z‘Z¨¯©¸D¿J¹JÑGˆÜ"¤T¨$£Z° O°TÐ9Ð9rI   c                ól   — t        |t        «      r|j                  dk(  S t        j                  |d«      S )zF
        Can we compare values of the given dtype to our own?
        Úm)r/   r   Úkindr   Úis_np_dtype)rG   r+   s     r=   Ú_is_comparable_dtypez#TimedeltaIndex._is_comparable_dtypeþ  s.   € ô �eœZÔ(Ø—:‘: Ñ$Ð$Ü�‰˜u cÓ*Ð*rI   c                óÂ   — | j                   j                  «       }t        | «      j                  || j                  ¬«      }| j
                  �| j
                   |_        |S ©NrQ   )rJ   Ú__neg__rR   r2   rL   r-   r,   ©rG   r<   Úidxs      r=   r‘   zTimedeltaIndex.__neg__	  sM   € Ø—‘×#Ñ#Ó%ˆÜ�4‹j×$Ñ$ V°$·)±)Ð$Ó<ˆØ�9‰9Ð ØŸ™˜
ˆCŒIØˆ
rI   c                óÀ   — | j                   j                  «       }t        | «      j                  || j                  ¬«      }| j
                  �| j
                  |_        |S r�   )rJ   Ú__pos__rR   r2   rL   r-   r,   r’   s      r=   r•   zTimedeltaIndex.__pos__  sK   € Ø—‘×#Ñ#Ó%ˆÜ�4‹j×$Ñ$ V°$·)±)Ð$Ó<ˆØ�9‰9Ð ØŸ	™	ˆCŒIØˆ
rI   c                ó(  •— t         ‰| �  ||«      }| j                  �t        |«      s|S d }t	        |t        | «      «      r| j                  ||«      }n4t        t        |dd «      dd «      dk(  r|t        u r| j                  |«      }|�||_
        |S )Nr+   rŒ   ÚM)ÚsuperÚ_arith_methodr-   r   r/   rR   Ú_get_arith_result_freqÚgetattrr   Ú_get_rsub_datetime_result_freqr,   )rG   ÚotherÚopr<   Únew_freqÚ	__class__s        €r=   r™   zTimedeltaIndex._arith_method  s”   ø€ Ü‘Ñ& u¨bÓ1ˆØ�9‰9Ð¤I¨eÔ$4ØˆMàˆÜ�fœd 4›jÔ)Ø×2Ñ2°5¸"Ó=‰Hä”G˜F G¨TÓ2°F¸DÓAÀSÒHÈRÔSWÉZð
 ×:Ñ:¸5ÓAˆHàÐØ#ˆFŒLØˆrI   c                ó  — | j                   }|€J ‚|t        j                  t        fv r,t	        t        |«      «      ry||z  }|j                  dk(  ry|S |t        j                  t        j                  fv r„t        |t        «      rN|j                  |z  dk(  rt        |j                  |z  «      }n(t        t        |j                  ¬«      «      |z  }n||z  }|j                  dk(  r|j                  dk7  ry|S |t        u r| S y)zµ
        Compute the result freq for arithmetic operations whose result
        is also a TimedeltaIndex.

        Caller is responsible for checking self.freq is not None.
        Nr   )r`   )r-   ÚoperatorÚmulr   Úboolr   ÚnÚtruedivÚfloordivr/   r	   r   r   Únanosr   )rG   r�   rž   r-   rŸ   s        r=   rš   z%TimedeltaIndex._get_arith_result_freq+  sò   € ð �y‰yˆØÐÐÐØ”(—,‘,¤Ð%Ñ%Ü”D˜“KÔ Øð ˜e‘|ˆHØ�z‰z˜QŠàØˆOà”(×"Ñ"¤H×$5Ñ$5Ð6Ñ6ô ˜$¤Ô$Ø—6‘6˜E‘> QÒ&Ü" 4§6¡6¨U¡?Ó3‘Hä(¬¸¿¹Ô)?Ó@À5ÑH‘Hà %™<�Ø�~‰~ Ò" t§z¡z°Q¢ð ØˆOà”‰:ð �5ˆLàrI   c                óâ   — | j                   }|€J ‚t        |t        «      r| S t        |t        «      r|j                  }nt        |«      j                  }|�t        j                  |«      r| S y)z°
        Compute the result freq for Timestamp/datetime - TimedeltaIndex.

        Mirrors the logic of _get_arithmetic_result_freq for the negated
        array case.
        N)r-   r/   r   r   Útzr   Úis_utc)rG   r�   r-   rª   s       r=   rœ   z-TimedeltaIndex._get_rsub_datetime_result_freqX  sk   € ð �y‰yˆØÐÐÐÜ�dœDÔ!Ø�5ˆLô �eœYÔ'Ø—‘‰Bä˜5Ó!×$Ñ$ˆBØˆ:œ×)Ñ)¨"Ô-Ø�5ˆLØrI   c                óÆ   — | j                  |«       	 | j                  j                  |d¬«      }t        j                  | |«      S # t        $ r}t	        |«      |‚d}~ww xY w)z…
        Get integer location for requested label

        Returns
        -------
        loc : int, slice, or ndarray[int]
        F)ÚunboxN)Ú_check_indexing_errorrJ   Ú_validate_scalarÚ	TypeErrorÚKeyErrorr   Úget_loc)rG   ÚkeyÚerrs      r=   r²   zTimedeltaIndex.get_locp  sa   € ð 	×"Ñ" 3Ô'ð	)Ø—*‘*×-Ñ-¨c¸Ð-Ó?ˆCô �}‰}˜T 3Ó'Ð'øô ò 	)Ü˜3“- SÐ(ûð	)ús   “A Á	A ÁAÁA c                óÚ   — t        |«      \  }}t        |t        «      r:t        |«      }t        j                  |j
                  «      }t        ||«      }||fS t        j                  }||fS rC   )r   r/   r   r
   Úget_reso_from_freqstrÚresolution_stringÚminÚRESO_SEC)rG   ÚlabelÚparsedÚstring_reso_codeÚstring_resoÚ
value_resoÚresos          r=   Ú_parse_with_resozTimedeltaIndex._parse_with_reso…  sp   € ô $?¸uÓ#EÑ ˆÐ Ü�fœiÔ(Ü$Ð%5Ó6ˆKô $×9Ñ9¸&×:RÑ:RÓSˆJÜ�{ JÓ/ˆDð �tˆ|Ðô ×&Ñ&ˆDØ�tˆ|ÐrI   c                óÖ   — |j                   }|j                  |«      }|t        |«      z   t        d| j                  ¬«      j                  | j                  «      z
  }|t        ||«      fS )Nrt   ©Úunit)Úattr_abbrevr\   r   r   rÃ   Úas_unitÚmax)rG   r¿   r»   Úreso_strÚlboundÚrbounds         r=   Ú_parsed_string_to_boundsz'TimedeltaIndex._parsed_string_to_bounds•  sf   € Ø×#Ñ#ˆØ—‘˜hÓ'ˆàÜ˜Ó!ñ"ä˜ §	¡	Ô*×2Ñ2°4·9±9Ó=ñ>ð 	ð ”s˜6 6Ó*Ð*Ð*rI   c                 ó   — y)NÚtimedelta64r{   rF   s    r=   Úinferred_typezTimedeltaIndex.inferred_type£  s   € àrI   )Úreturnztype[libindex.TimedeltaEngine])r<   z
np.ndarrayrÎ   r   )r<   r   rÎ   r   )rÎ   r   )ÚraiserÏ   )rY   r$   rZ   r%   rÎ   r   )rÎ   r(   )rÎ   znpt.NDArray[np.object_])rl   úAxisInt | Noner+   úNpDtype | Nonern   r¤   rp   r¤   rq   ÚintrÎ   úTimedelta | NaTType)rl   rÐ   r+   rÑ   rv   rÒ   rn   r¤   rp   r¤   rÎ   rÓ   )rl   rÐ   rp   r¤   rÎ   rÓ   )rM   zbool | None)r+   r"   rÎ   r¤   )rÎ   r0   )r�   Úobjectrž   úCallable[..., Any]rÎ   r   )r�   rÔ   rž   rÕ   rÎ   úDay | Tick | None)r�   rÔ   rÎ   rÖ   )rº   ÚstrrÎ   z&tuple[Timedelta | NaTType, Resolution])r¿   r
   r»   r   )rÎ   r×   )*Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_typr   Ú	_data_clsÚpropertyrH   Ú__annotations__r   Ú_get_string_slicerO   rS   rU   rW   r\   r^   r`   rb   rd   rf   rh   rj   rs   rx   r|   r   r‚   r7   r‰   rŽ   r‘   r•   r™   rš   rœ   r²   rÀ   rÊ   rÍ   Ú__classcell__)r    s   @r=   r0   r0   ^   s¯  ø… ñEðN €Dà€Iàò(ó ð(ð Óð ×/Ñ/Ðó
Mó>óCðJ $+Ø'.ð	6Tð !ð6Tð %ð	6Tð
 
ó6Tðv $+Ø'.ð	5Tð !ð5Tð %ð	5Tð
 
ó5Tðt $+Ø'.ð	5Sð !ð5Sð %ð	5Sð
 
ó5Sðn ò8ó ð8ð2 ò;ó ð;ð0 ò@ó ð@ð2 ò?ó ð?ð2 ò%ó ð%ó:+ðF  $Ø $ØØØØØñ7
ð ð7
ð ð	7
ð ð7
ð ð7
ð ð7
ð 
ó7
ðx  $Ø $ØØØØñ1
ð ð1
ð ð	1
ð ð1
ð ð1
ð ð1
ð 
ó1
ðl  $Øñ	'Eð ð'Eð ð	'Eð 
ó'Eð\ Ø�^‰^ØØ Øð2ð
 ó2òh:ó+óóõð(+Øð+Ø!3ð+à	ó+óZò0(ó*ó 
+ð òó ôrI   r0   rÂ   c               óv  — |€t        j                  || |«      rd}t        |«      }t        j                  | |||«      dk7  rt	        d«      ‚|�€0| �‰|�‡t        | «      } t        |«      }t        d| «      } t        d|«      }t        | j                  «      t        |j                  «      kD  rt        d| j                  «      }ntt        d|j                  «      }n]| �.t        | «      } t        d| «      } t        d| j                  «      }n-t        |«      }t        d|«      }t        d|j                  «      }|�Ft        d|«      }t        |«      }|j                  |kD  r t        d|j                  j                  «      }t        j                  | |||||¬«      }t        j                  ||¬«      }	||	_        |	S )	a“  
    Return a fixed frequency TimedeltaIndex with day as the default.

    This function generates a sequence of evenly spaced timedelta values
    between the specified bounds, using day as the default frequency.

    Parameters
    ----------
    start : str or timedelta-like, default None
        Left bound for generating timedeltas.
    end : str or timedelta-like, default None
        Right bound for generating timedeltas.
    periods : int, default None
        Number of periods to generate.
    freq : str, Timedelta, datetime.timedelta, or DateOffset, default 'D'
        Frequency strings can have multiples, e.g. '5h'.
    name : Hashable, default None
        Name of the resulting TimedeltaIndex.
    closed : str, default None
        Make the interval closed with respect to the given frequency to
        the 'left', 'right', or both sides (None).
    unit : {'s', 'ms', 'us', 'ns', None}, default None
        Specify the desired resolution of the result.
        If not specified, this is inferred from the 'start', 'end', and 'freq'
        using the same inference as :class:`Timedelta` taking the highest
        resolution of the three that are provided.

        .. versionadded:: 2.0.0

    Returns
    -------
    TimedeltaIndex
        Fixed frequency, with day as the default.

    See Also
    --------
    date_range : Return a fixed frequency DatetimeIndex.
    period_range : Return a fixed frequency PeriodIndex.

    Notes
    -----
    Of the four parameters ``start``, ``end``, ``periods``, and ``freq``,
    a maximum of three can be specified at once. Of the three parameters
    ``start``, ``end``, and ``periods``, at least two must be specified.
    If ``freq`` is omitted, the resulting ``DatetimeIndex`` will have
    ``periods`` linearly spaced elements between ``start`` and ``end``
    (closed on both sides).

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

    Examples
    --------
    >>> pd.timedelta_range(start="1 day", periods=4)
    TimedeltaIndex(['1 days', '2 days', '3 days', '4 days'],
                   dtype='timedelta64[us]', freq='D')

    The ``closed`` parameter specifies which endpoint is included.  The default
    behavior is to include both endpoints.

    >>> pd.timedelta_range(start="1 day", periods=4, closed="right")
    TimedeltaIndex(['2 days', '3 days', '4 days'],
                   dtype='timedelta64[us]', freq='D')

    The ``freq`` parameter specifies the frequency of the TimedeltaIndex.
    Only fixed frequencies can be passed, non-fixed frequencies such as
    'M' (month end) will raise.

    >>> pd.timedelta_range(start="1 day", end="2 days", freq="6h")
    TimedeltaIndex(['1 days 00:00:00', '1 days 06:00:00', '1 days 12:00:00',
                    '1 days 18:00:00', '2 days 00:00:00'],
                   dtype='timedelta64[us]', freq='6h')

    Specify ``start``, ``end``, and ``periods``; the frequency is generated
    automatically (linearly spaced).

    >>> pd.timedelta_range(start="1 day", end="5 days", periods=4)
    TimedeltaIndex(['1 days 00:00:00', '2 days 08:00:00', '3 days 16:00:00',
                    '5 days 00:00:00'],
                   dtype='timedelta64[us]', freq=None)

    **Specify a unit**

    >>> pd.timedelta_range("1 Day", periods=3, freq="100000D", unit="s")
    TimedeltaIndex(['1 days', '100001 days', '200001 days'],
                   dtype='timedelta64[s]', freq='100000D')
    ÚDé   zVOf the four parameters: start, end, periods, and freq, exactly three must be specifiedr   r&   z
Tick | Day)ÚclosedrÃ   rQ   )ÚcomÚany_noner   Úcount_not_noneÚ
ValueErrorr   r   r   rÃ   Ú_cresoÚbaseÚfreqstrr   Ú_generate_ranger0   r2   r,   )
ÚstartÚendÚperiodsr-   rL   rå   rÃ   Úcresor:   r<   s
             r=   Útimedelta_rangerò   ¨  sœ  € ðD €|œŸ™ W¨e°SÔ9ØˆÜ�T‹?€Dä
×Ñ˜%  g¨tÓ4¸Ò9äð8ó
ð 	
ð
 �|ð Ð  Ü˜eÓ$ˆEÜ˜C“.ˆCÜ˜ eÓ,ˆEÜ�{ CÓ(ˆCÜ! %§*¡*Ó-Ô0BÀ3Ç8Á8Ó0LÒLÜ˜J¨¯
©
Ó3‘ä˜J¨¯©Ó1‘ØÐÜ˜eÓ$ˆEÜ˜ eÓ,ˆEÜ˜
 E§J¡JÓ/‰Dä˜C“.ˆCÜ�{ CÓ(ˆCÜ˜
 C§H¡HÓ-ˆDð ÐÜ˜ dÓ+ˆDÜ& tÓ,ˆEØ�{‰{˜UÒ"Ü˜J¨¯	©	×(9Ñ(9Ó:�ä×*Ñ*Øˆs�G˜T¨&°tô€Eô ×'Ñ'¨°DÐ'Ó9€FØ€F„LØ€MrI   )NNNNNN)rð   z
int | NonerÃ   zTimeUnit | NonerÎ   r0   )ErÛ   Ú
__future__r   r¢   Útypingr   r   r   r4   Úpandas._libsr   rD   r   Úpandas._libs.tslibsr	   r
   r   r   r   r   r   Úpandas._libs.tslibs.dtypesr   Úpandas._libs.tslibs.timedeltasr   Úpandas.util._decoratorsr   Úpandas.core.dtypes.commonr   r   Úpandas.core.dtypes.dtypesr   Úpandas.core.dtypes.genericr   Úpandas.core.dtypes.missingr   Úpandas.core.arrays.timedeltasr   Úpandas.core.commonÚcoreÚcommonræ   Úpandas.core.indexes.baser   r   Ú pandas.core.indexes.datetimeliker   Úpandas.core.roperatorr   r   Úcollections.abcr   r   ÚnumpyÚnpr    Úpandas._typingr!   r"   r#   r$   r%   r&   r'   r?   r(   r>   r0   rò   r{   rI   r=   ú<module>r	     s  ðÙ "å "ã ÷ñ ó
 ÷÷÷ ñ õ :Ý FÝ .÷õ 1Ý 0Ý +å 8ß  Ð  ÷õ D÷ñ
 Ý(Ýãå$÷÷ ñ õ !òñ0 ˆHÓôFÐ+ó Fó ðFñR ˆHÓà
ØØØ	Ø	ØðNð !ñNð ðNð ðNð òNó ñNrI   