Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/core/arrays/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/core/arrays/__pycache__/datetimes.cpython-312.pyc

�

Mٜg�h��6�ddlmZddlmZmZmZddlmZmZmZddl	Z	ddl
Zddlm
Z
mZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&dd	l'm(Z(dd
l)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5dd
l6m7Z7ddl8m9Z:ddl;m<Z<ddl=m>cm?Z@ddlAmBZBddlCmDZDmEZEer&ddlFmGZGddlHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPddlQmRZRddl8mSZSdZTed+d,d��ZUed+d-d��ZU	d.					d/d�ZUd0d1d�ZVGd�de:j�e:j��ZYddddddd�													d2d �ZZ										d3d!�Z[				d4									d5d"�Z\d0d6d#�Z]d7d$�Z^d%�Z_	d8					d9d&�Z`								d:d'�Za						d;d(�Zb				d<d)�Zc										d=d*�Zdy)>�)�annotations)�datetime�	timedelta�tzinfo)�
TYPE_CHECKING�cast�overloadN)�lib�tslib)�
BaseOffset�NaT�NaTType�
Resolution�	Timestamp�astype_overflowsafe�fields�get_resolution�get_supported_dtype�get_unit_from_dtype�ints_to_pydatetime�is_date_array_normalized�is_supported_dtype�is_unitless�normalize_i8_timestamps�	timezones�	to_offset�tz_convert_from_utc�tzconversion)�abbrev_to_npy_unit)�PerformanceWarning)�find_stack_level)�validate_inclusive)�DT64NS_DTYPE�INT64_DTYPE�
is_bool_dtype�is_float_dtype�is_string_dtype�pandas_dtype)�DatetimeTZDtype�ExtensionDtype�PeriodDtype)�isna)�datetimelike)�generate_regular_range)�get_period_alias)�Day�Tick)�Iterator)�	ArrayLike�DateTimeErrorChoices�DtypeObj�IntervalClosedType�Self�
TimeAmbiguous�TimeNonexistent�npt��	DataFrame��PeriodArrayi'c��y�N���tz�units  �G/usr/local/lib/python3.12/site-packages/pandas/core/arrays/datetimes.py�tz_to_dtyperF]����c��yr@rArBs  rErFrFbrGrHc�R�|�tjd|�d��St||��S)z�
    Return a datetime64[ns] dtype appropriate for the given timezone.

    Parameters
    ----------
    tz : tzinfo or None
    unit : str, default "ns"

    Returns
    -------
    np.dtype or Datetime64TZDType
    �M8[�]rB)�np�dtyper)rBs  rErFrFgs-��
�z��x�x�#�d�V�1�
�&�&��"�4�0�0rHc�@���fd�}||_||_t|�S)Nc���|j�}�|jvr��jd�rn|j}d}|r.|j}|jd|jdd��}t
j|�|j||j��}|St
j|�|j��}|S�|jvr7t
j|�|j��}|j|d��}|St
j|�|j��}|j|dd��}|S)	N)�start�end��
startingMonth�month��reso��
fill_value�float64)rY�convert)�_local_timestamps�	_bool_ops�endswith�freq�kwds�getr�get_start_end_field�freqstr�_creso�get_date_field�_object_ops�get_date_name_field�_maybe_mask_results)�self�valuesr_�month_kwr`�result�fields      �rE�fz_field_accessor.<locals>.f}s+����'�'�)���D�N�N�"��~�~�.�/��y�y������9�9�D�#�x�x�����'�2�9N�O�H��3�3��E�4�<�<��������M� �.�.�v�u�4�;�;�O���M��D�$�$�$��/�/���D�K�K�P�F��-�-�f��-�F�F��
��*�*�6�5�t�{�{�K�F��-�-��4��.��F��
rH)�__name__�__doc__�property)�namerm�	docstringrns `  rE�_field_accessorrt|s#��� �D�A�J��A�I��A�;�rHc	����eZdZUdZdZejdd�ZeejfZ	d�Z
dZedzd��Z
gd�Zd	ed
<ddgZd	ed
<gd�Zd	ed<gd�Zd	ed<eezezezdgzZd	ed<gd�Zd	ed<dZded<dZded<eZed{d��Zed��Zedef							d|�fd�
�Zeddd �d}d!��Zeddej>ej>ddd"d#�											d~d$��Z e					ddd%�													d�d&��Z!d�d'�Z"d�d(�Z#d�d)�Z$d�d*�Z%ed�d+��Z&ed�d,��Z'e'jPd-��Z'ed�d.��Z)ed�d/��Z*ed�d0��Z+d�d��fd1�
Z,d�d2�Z-d�d}�fd3�
Z.ddd4�			d�d5�Z/d�d6�Z0d�d7�Z1d�d8�Z2d�d9�Z3d�d:�Z4e5jl		d�					d�d;��Z7d�d<�Z8d�d=�Z9d�d�d>�Z:d�d�d?�Z;d�d�d@�Z<ed�dA��Z=ed�dB��Z>ed�dC��Z?d�dD�Z@eAdEdFdG�ZBeAdHdIdJ�ZCeAdKdLdM�ZDeAdNdOdP�ZEeAdQdRdS�ZFeAdTdUdV�ZGeAdWdXdY�ZHeAdZdd[�ZId\ZJeAd]d^eJ�ZKeKZLeKZMeAd_d`da�ZNeNZOeAdbdcdd�ZPeAdedfdg�ZQeQZRdhZSeAdidieSj�dj�k��ZUeAdldleSj�dm�k��ZVeAdndndo�ZWeAdpdpdq�ZXeAdrdrds�ZYeAdtdtdu�ZZeAdvdvdw�Z[d�dx�Z\						d�					d�dy�Z]�xZ^S)��
DatetimeArraya{
    Pandas ExtensionArray for tz-naive or tz-aware datetime data.

    .. warning::

       DatetimeArray is currently experimental, and its API may change
       without warning. In particular, :attr:`DatetimeArray.dtype` is
       expected to change to always be an instance of an ``ExtensionDtype``
       subclass.

    Parameters
    ----------
    values : Series, Index, DatetimeArray, ndarray
        The datetime data.

        For DatetimeArray `values` (or a Series or Index boxing one),
        `dtype` and `freq` will be extracted from `values`.

    dtype : numpy.dtype or DatetimeTZDtype
        Note that the only NumPy dtype allowed is 'datetime64[ns]'.
    freq : str or Offset, optional
        The frequency.
    copy : bool, default False
        Whether to copy the underlying array of values.

    Attributes
    ----------
    None

    Methods
    -------
    None

    Examples
    --------
    >>> pd.arrays.DatetimeArray._from_sequence(
    ...    pd.DatetimeIndex(['2023-01-01', '2023-01-02'], freq='D'))
    <DatetimeArray>
    ['2023-01-01 00:00:00', '2023-01-02 00:00:00']
    Length: 2, dtype: datetime64[ns]
    �
datetimearrayr
�nsc�R�tj|d�xst|t�S�N�M)r
�is_np_dtype�
isinstancer))�xs rE�<lambda>zDatetimeArray.<lambda>�s&��S�_�_�Q��%<�&�
�	�?�A�&rH)r�
datetime64�datec��tSr@)r�ris rE�_scalar_typezDatetimeArray._scalar_type�s���rH)�is_month_start�is_month_end�is_quarter_start�is_quarter_end�
is_year_start�is_year_end�is_leap_yearz	list[str]r]r_rCrf)�yearrU�day�hour�minute�second�weekday�	dayofweek�day_of_week�	dayofyear�day_of_year�quarter�
days_in_month�daysinmonth�microsecond�
nanosecond�
_field_ops)r��time�timetz�
_other_opsrD�_datetimelike_ops)�	to_period�tz_localize�
tz_convert�	normalize�strftime�round�floor�ceil�
month_name�day_name�as_unit�_datetimelike_methodsi��)np.dtype[np.datetime64] | DatetimeTZDtype�_dtypeN�BaseOffset | None�_freqc�f�tj|d��dvrt�|j||��S)NT��skipna)rr��rN)r
�infer_dtype�
ValueError�_from_sequence)�cls�scalarsrNs   rE�
_from_scalarszDatetimeArray._from_scalarss4���?�?�7�4�0�8R�R����!�!�'��!�7�7rHc�*�t|�}t|j�t|tj�r|j|k7rt	d��|Stj
|j�d}||jk7rt	d��|S)Nz'Values resolution does not match dtype.r)�_validate_dt64_dtyperNr}rMr��
datetime_datarD)r�rjrN�vunits    rE�_validate_dtypezDatetimeArray._validate_dtype!s��%�U�+���V�\�\�*��e�R�X�X�&��|�|�u�$� �!J�K�K�
���$�$�V�\�\�2�1�5�E���
�
�"� �!J�K�K��rHc�H��t|tj�sJ�|jdk(sJ�t|tj�r||jk(sJ�t|�r&J�|jt|j�k(sJ�t�|�%||�}||_
|Srz)r}rM�ndarray�kindrNrrdr�super�_simple_newr�)r�rjr_rNrl�	__class__s     �rEr�zDatetimeArray._simple_new0s�����&�"�*�*�-�-�-��z�z�S� � � ��e�R�X�X�&��F�L�L�(�(�(�"�5�)�)�)��<�<�#6�v�|�|�#D�D�D�D���$�V�U�3������
rHF�rN�copyc�*�|j|||��S�Nr�)�_from_sequence_not_strict)r�r�rNr�s    rEr�zDatetimeArray._from_sequenceEs���,�,�W�E��,�M�MrH�raise)rNr�rCr_�dayfirst�	yearfirst�	ambiguousc	��|du}	|tjurd}ntj|�}t	|�}t|||	�}d}
|�t
j|�}
t
j||d��\}}d}t|t�r|j}t|||||||
��\}}t|||	�|�
|	rtd��tj|j �d}
t#||
�}|j%|||��}|
� |
|j&k7r|j)|
�}d|i}|j+||�|S)	z\
        A non-strict version of _from_sequence, called from DatetimeIndex.__new__.
        Nrv)�cls_name�r�rCr�r�r��out_unitz^Passed data is timezone-aware, incompatible with 'tz=None'. Use obj.tz_localize(None) instead.r�r_rNr�)r
�
no_defaultr�maybe_get_tzr��_validate_tz_from_dtype�dtl�
dtype_to_unit�!ensure_arraylike_for_datetimeliker}rvr_�_sequence_to_dt64r�rMr�rNrFr�rDr��_maybe_pin_freq)r��datarNr�rCr_r�r�r��explicit_tz_nonerD�
inferred_freq�subarr�	data_unit�
data_dtyperl�
validate_kwdss                 rEr�z'DatetimeArray._from_sequence_not_strictIs]��&��:��
������B��'�'��+�B�$�U�+��
$�U�B�0@�
A�������$�$�U�+�D��:�:��$��
�
��d��
��d�M�*� �I�I�M�&��������
�
���	 ��r�+;�<�
�>�.��5��
�
�$�$�V�\�\�2�1�5�	� ��Y�/�
�����m�:��N�������� 3��^�^�D�)�F�$�i�0�
����t�]�3��
rH�rDc
���tj|�}|� td�|||fD��rtd��t	j
||||�dk7rtd��t
|�}|�t|�}|�t|�}|tus|turtd��|
�|
dvr
td��d}
|�|j|
d	�
�}|�|j|
d	�
�}t|	�\}}t|||�\}}t|||�}|�t|||||�}t|||||�}|��'t|t�r&|�|j!d�}|�|j!d�}t|t"�rt%|||||
��}
nMt'|||||
��}t)j*|D�cgc]}|j,��c}t(j.�
�}
|�|j0n|j0}|��|��t3j4|�s%t7|
�}t9j:|
||||��}
|�|j!|||�}|��|j!|||�}nmt=t>|�}t)j@d|j,|j,z
|d�
�|j,z}
|
jBdk7r|
jEd�}
||k(r
|sj|sh|
dd}
nbt|�j,}t|�j,}|r|s4|stG|
�r
|
d|k(r|
dd}
|stG|
�r
|
d|k(r|
dd}
|
jId|
�d��}tK||
��}|jM|||��Scc}w)Nc3�$K�|]}|du���
y�wr@rA)�.0r~s  rE�	<genexpr>z0DatetimeArray._generate_range.<locals>.<genexpr>�s����I�3H�a��T�	�3H�s�z1Must provide freq argument if no data is supplied�zVOf the four parameters: start, end, periods, and freq, exactly three must be specifiedz$Neither `start` nor `end` can be NaT)�s�ms�usrxz+'unit' must be one of 's', 'ms', 'us', 'ns'rxF)�round_okr�)rQrR�periods�offsetrDr��r��nonexistent�cresor�int64�i8����zdatetime64[rLr�)'r��validate_periods�anyr��com�count_not_nonerrr
r�r"�_maybe_normalize_endpoints�_infer_tz_from_endpoints�_maybe_localize_pointr}r0r�r1r.�_generate_rangerM�array�_valuer�rCr�is_utcrr�tz_localize_to_utcr�int�linspacerN�astype�len�viewrFr�)r�rQrRr�r_rCr�r�r��	inclusiverD�left_inclusive�right_inclusive�i8values�xdrr~�endpoint_tzr��start_i8�end_i8�dt64_valuesrNs                      rEr�zDatetimeArray._generate_range�s����&�&�w�/���<�C�I�G�U�C�3H�I�I��P�Q�Q����e�S�'�4�8�A�=��<��
��������e�$�E��?��C�.�C��C�<�3�#�:��C�D�D����2�2� �!N�O�O��D����M�M�$��M�7�E��?��+�+�d�U�+�3�C�*<�Y�*G�'���/��s�I�F�
��s�
%�e�S�"�
5��
�>�)�%��r�9�k�R�E�'��T�2�y�+�N�C����$��$��$�!�-�-�d�3�E��?��/�/�$�/�C��$��%�1�%��g�t�RV�W��%��S�'�$�T����8�8�s�$;�s�!�Q�X�X�s�$;�2�8�8�L��&+�&7�%�(�(�S�V�V�K��~�+�"5� �'�'��+�/�t�4�E�+�>�>� ��"+�$/�#� �H��$�!�-�-�b�)�[�I�E��?��/�/�"�i��E�C��3��(�G����A�s�z�z�E�L�L�8�'��Q��,�,��
��~�~��%�$�?�?�4�0���C�<�!�/�#�A�b�>�� ��'�.�.�H��s�^�*�*�F�!��%�#�h�-�H�Q�K�8�<S�'���|�H�&�3�x�=�X�b�\�V�=S�'���}�H��m�m�k�$��q�$9�:���B�T�*�����{��U��C�C��i%<s�#M$c�$�t||j�s|turtd��|j	|�|tur*tj|j|j�S|j|j�jS)Nz'value' should be a Timestamp.)r}r�r
r��_check_compatible_withrMr�r�rDr��asm8�ri�values  rE�
_unbox_scalarzDatetimeArray._unbox_scalar
sl���%��!2�!2�3��S�8H��=�>�>��#�#�E�*��C�<��=�=����t�y�y�9�9��=�=����+�0�0�0rHc�0�t||j��S)N�rC)rrCrs  rE�_scalar_from_stringz!DatetimeArray._scalar_from_strings����4�7�7�+�+rHc�8�|tury|j|�yr@)r
�_assert_tzawareness_compat)ri�others  rErz$DatetimeArray._check_compatible_withs���C�<���'�'��.rHc��|jd�}tj||j|j��}|S)Nr�)rWrC)rr�_from_value_and_resordrC)rir~r�tss    rE�	_box_funczDatetimeArray._box_func!s0�����t���
�
+�
+�E�������
P���	rHc��|jS)a%
        The dtype for the DatetimeArray.

        .. warning::

           A future version of pandas will change dtype to never be a
           ``numpy.dtype``. Instead, :attr:`DatetimeArray.dtype` will
           always be an instance of an ``ExtensionDtype`` subclass.

        Returns
        -------
        numpy.dtype or DatetimeTZDtype
            If the values are tz-naive, then ``np.dtype('datetime64[ns]')``
            is returned.

            If the values are tz-aware, then the ``DatetimeTZDtype``
            is returned.
        )r�r�s rErNzDatetimeArray.dtype's��.�{�{�rHc�0�t|jdd�S)a�
        Return the timezone.

        Returns
        -------
        datetime.tzinfo, pytz.tzinfo.BaseTZInfo, dateutil.tz.tz.tzfile, or None
            Returns None when the array is tz-naive.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.tz
        datetime.timezone.utc

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.tz
        datetime.timezone.utc
        rCN)�getattrrNr�s rErCzDatetimeArray.tz@s��>�t�z�z�4��.�.rHc��td��)NzNCannot directly set timezone. Use tz_localize() or tz_convert() as appropriate)�AttributeErrorrs  rErCzDatetimeArray.tzas���
-�
�	
rHc��|jS)z(
        Alias for tz attribute
        rr�s rErzDatetimeArray.tzinfois
��
�w�w�rHc�Z�t|j|j|j��S)zN
        Returns True if all of the dates are at midnight ("no time")
        rV)r�asi8rCrdr�s rE�
is_normalizedzDatetimeArray.is_normalizedps��
(��	�	�4�7�7����M�MrHc�Z�t|j|j|j��S)NrV)rr&rCrdr�s rE�_resolution_objzDatetimeArray._resolution_objws���d�i�i����t�{�{�C�CrHc�N��|�|jrt}t�|�
||��Sr�)rC�objectr��	__array__)rirNr�r�s   �rEr,zDatetimeArray.__array__~s(����=�T�W�W��E��w� �u�4� �8�8rHc#�hK�|jdkDr!tt|��D]	}||���y|j}t|�}t}||zdz}t|�D]I}||z}t|dz|z|�}t
||||jd|j��}|Ed{����Ky7��w)zt
        Return an iterator over the boxed values

        Yields
        ------
        tstamp : Timestamp
        r��	timestamp)rC�boxrWN)	�ndim�rangerr&�_ITER_CHUNKSIZE�minrrCrd)	ri�ir��length�	chunksize�chunks�start_i�end_i�	converteds	         rE�__iter__zDatetimeArray.__iter__�s������9�9�q�=��3�t�9�%���1�g�
�&��9�9�D���Y�F�'�I��	�)�Q�.�F��6�]���i�-���Q��U�i�/��8��.����'��w�w�#����	�	�%�$�$�#�%�s�B&B2�(B0�)B2c���t|�}||jk(r|r|j�S|St|t�r�t|t
�st�|�||��S|j�td��tj|j�}t|j||��}t|�j|||j ��S|j�jt#j$|d�rTt'|�sIt)|�r>t|j|d��}t|�j||j��S|j�!t#j$|d�rtd��|j�;t#j$|d�r%||jk7rt'|�rtd��t|t*�r|j-|j �	�St.j0j|||�S)
N�r�z�Cannot use .astype to convert from timezone-naive dtype to timezone-aware dtype. Use obj.tz_localize instead or series.dt.tz_localize instead�rNr_r{Tr�z�Cannot use .astype to convert from timezone-aware dtype to timezone-naive dtype. Use obj.tz_localize(None) or obj.tz_convert('UTC').tz_localize(None) instead.z]Casting to unit-less dtype 'datetime64' is not supported. Pass e.g. 'datetime64[ns]' instead.)r_)r(rNr�r}r*r)r�rrC�	TypeErrorrM�strr�_ndarray�typer�r_r
r|rrr+r�r��DatetimeLikeArrayMixin)rirNr��np_dtype�
res_valuesr�s     �rErzDatetimeArray.astype�s����
�U�#���D�J�J����y�y�{�"��K�
��~�
.��e�_�5��w�~�e�$�~�7�7����� �4����8�8�E�I�I�.��0�����t�T�
��D�z�-�-�j��D�I�I�-�V�V�
�G�G�O�����s�+���&�"�5�)�-�T�]�]�E��M�J���:�)�)�*�J�<L�<L�)�M�M��W�W�
 �S�_�_�U�C�%@��C��
�
�G�G�O�����s�+�����#��E�"��6��
�
��{�
+��>�>�u�z�z�>�2�2��)�)�0�0��u�d�C�CrH)�na_rep�date_formatc��|�|jrd}tj|j|j|||j
��S)Nz%Y-%m-%d)rC�formatrFrW)�_is_dates_onlyr�format_array_from_datetimer&rCrd)rirFrG�kwargss    rE�_format_native_typesz"DatetimeArray._format_native_types�sA����4�#6�#6�$�K��/�/��I�I�$�'�'�+�f�4�;�;�
�	
rHc��t|tj�rt|�}t	|d�sy|j
}t
j|j
|�S)NrF)r}rMr�r�hasattrrr�
tz_compare)rir�other_tzs   rE�_has_same_tzzDatetimeArray._has_same_tz�sG���e�R�]�]�+��e�$�E��u�h�'���<�<���#�#�D�K�K��:�:rHc���t|dd�}t|dd�}t|t�r|jj}|t
ury|j�|�t
d��y|�t
d��y)NrrNz;Cannot compare tz-naive and tz-aware datetime-like objects.z:Cannot compare tz-naive and tz-aware datetime-like objects)r!r}r)rNrCr
r?)rirrQ�other_dtypes    rErz(DatetimeArray._assert_tzawareness_compats����5�(�D�1���e�W�d�3���k�?�3��{�{�~�~�H��C�<��
�W�W�_��#��Q���$��
��L��
�rHc�0�t|t�rJ�|j�|jd�}n|}	|j	|j
�}|jjdk(r|j|j�}t|�j||j��}|jr|j�}d|_|j�|j|j�}|S#t$r�tjdt t#���|j%d�|z}t|�j'|�j)|j*�}t-|�s|j|j�cYSY|SwxYw)Nr4r�zCNon-vectorized DateOffset being applied to Series or DatetimeIndex.��
stacklevel�O)r}r1rCr��_apply_arrayrArNr�rrBr�r�r��NotImplementedError�warnings�warnr r!rr�r�rDr)rir�rjrErls     rE�_add_offsetzDatetimeArray._add_offsets]���f�d�+�+�+��7�7���%�%�d�+�F��F�	5��,�,�V�_�_�=�J����$�$��+�(�_�_�V�\�\�:�
��$�Z�+�+�J�j�>N�>N�+�O�F�����)�)�+��#����w�w�"��+�+�D�G�G�4���
��-#�	3��M�M�U�"�+�-�
�
���S�)�F�2�J��$�Z�.�.�z�:�B�B�4�9�9�M�F��t�9��)�)�$�'�'�2�2���
�-	3�s�AC5�5BF�Fc���|j�tj|j�r|jSt	|j|j|j
��S)z�
        Convert to an i8 (unix-like nanosecond timestamp) representation
        while keeping the local timezone and not using UTC.
        This is used to calculate time-of-day information as if the timestamps
        were timezone-naive.
        rV)rCrr�r&rrdr�s rEr\zDatetimeArray._local_timestampsCsC���7�7�?�i�.�.�t�w�w�7��9�9��"�4�9�9�d�g�g�D�K�K�H�HrHc���tj|�}|j�td��t	||j
��}|j
|j||j��S)a	
        Convert tz-aware Datetime Array/Index from one time zone to another.

        Parameters
        ----------
        tz : str, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None
            Time zone for time. Corresponding timestamps would be converted
            to this time zone of the Datetime Array/Index. A `tz` of None will
            convert to UTC and remove the timezone information.

        Returns
        -------
        Array or Index

        Raises
        ------
        TypeError
            If Datetime Array/Index is tz-naive.

        See Also
        --------
        DatetimeIndex.tz : A timezone that has a variable offset from UTC.
        DatetimeIndex.tz_localize : Localize tz-naive DatetimeIndex to a
            given time zone, or remove timezone from a tz-aware DatetimeIndex.

        Examples
        --------
        With the `tz` parameter, we can change the DatetimeIndex
        to other time zones:

        >>> dti = pd.date_range(start='2014-08-01 09:00',
        ...                     freq='h', periods=3, tz='Europe/Berlin')

        >>> dti
        DatetimeIndex(['2014-08-01 09:00:00+02:00',
                       '2014-08-01 10:00:00+02:00',
                       '2014-08-01 11:00:00+02:00'],
                      dtype='datetime64[ns, Europe/Berlin]', freq='h')

        >>> dti.tz_convert('US/Central')
        DatetimeIndex(['2014-08-01 02:00:00-05:00',
                       '2014-08-01 03:00:00-05:00',
                       '2014-08-01 04:00:00-05:00'],
                      dtype='datetime64[ns, US/Central]', freq='h')

        With the ``tz=None``, we can remove the timezone (after converting
        to UTC if necessary):

        >>> dti = pd.date_range(start='2014-08-01 09:00', freq='h',
        ...                     periods=3, tz='Europe/Berlin')

        >>> dti
        DatetimeIndex(['2014-08-01 09:00:00+02:00',
                       '2014-08-01 10:00:00+02:00',
                       '2014-08-01 11:00:00+02:00'],
                        dtype='datetime64[ns, Europe/Berlin]', freq='h')

        >>> dti.tz_convert(None)
        DatetimeIndex(['2014-08-01 07:00:00',
                       '2014-08-01 08:00:00',
                       '2014-08-01 09:00:00'],
                        dtype='datetime64[ns]', freq='h')
        z?Cannot convert tz-naive timestamps, use tz_localize to localizer�r>)	rr�rCr?rFrDr�rAr_)rirCrNs   rEr�zDatetimeArray.tz_convertOs`��@�
#�
#�B�
'���7�7�?��Q��
�
�B�T�Y�Y�/������
�
�U�����K�KrHc��d}||vrt|t�std��|j�:|�-t	|j
|j|j��}nNtd��tj|�}tj|j
||||j��}|jd|j�d��}t||j�	�}d}tj|�st!|�d
k(rt#|d�s
|j$}n|�|j�|j$}|j'|||��S)
a�
        Localize tz-naive Datetime Array/Index to tz-aware Datetime Array/Index.

        This method takes a time zone (tz) naive Datetime Array/Index object
        and makes this time zone aware. It does not move the time to another
        time zone.

        This method can also be used to do the inverse -- to create a time
        zone unaware object from an aware object. To that end, pass `tz=None`.

        Parameters
        ----------
        tz : str, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None
            Time zone to convert timestamps to. Passing ``None`` will
            remove the time zone information preserving local time.
        ambiguous : 'infer', 'NaT', bool array, default 'raise'
            When clocks moved backward due to DST, ambiguous times may arise.
            For example in Central European Time (UTC+01), when going from
            03:00 DST to 02:00 non-DST, 02:30:00 local time occurs both at
            00:30:00 UTC and at 01:30:00 UTC. In such a situation, the
            `ambiguous` parameter dictates how ambiguous times should be
            handled.

            - 'infer' will attempt to infer fall dst-transition hours based on
              order
            - bool-ndarray where True signifies a DST time, False signifies a
              non-DST time (note that this flag is only applicable for
              ambiguous times)
            - 'NaT' will return NaT where there are ambiguous times
            - 'raise' will raise an AmbiguousTimeError if there are ambiguous
              times.

        nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, default 'raise'
            A nonexistent time does not exist in a particular timezone
            where clocks moved forward due to DST.

            - 'shift_forward' will shift the nonexistent time forward to the
              closest existing time
            - 'shift_backward' will shift the nonexistent time backward to the
              closest existing time
            - 'NaT' will return NaT where there are nonexistent times
            - timedelta objects will shift nonexistent times by the timedelta
            - 'raise' will raise an NonExistentTimeError if there are
              nonexistent times.

        Returns
        -------
        Same type as self
            Array/Index converted to the specified time zone.

        Raises
        ------
        TypeError
            If the Datetime Array/Index is tz-aware and tz is not None.

        See Also
        --------
        DatetimeIndex.tz_convert : Convert tz-aware DatetimeIndex from
            one time zone to another.

        Examples
        --------
        >>> tz_naive = pd.date_range('2018-03-01 09:00', periods=3)
        >>> tz_naive
        DatetimeIndex(['2018-03-01 09:00:00', '2018-03-02 09:00:00',
                       '2018-03-03 09:00:00'],
                      dtype='datetime64[ns]', freq='D')

        Localize DatetimeIndex in US/Eastern time zone:

        >>> tz_aware = tz_naive.tz_localize(tz='US/Eastern')
        >>> tz_aware
        DatetimeIndex(['2018-03-01 09:00:00-05:00',
                       '2018-03-02 09:00:00-05:00',
                       '2018-03-03 09:00:00-05:00'],
                      dtype='datetime64[ns, US/Eastern]', freq=None)

        With the ``tz=None``, we can remove the time zone information
        while keeping the local time (not converted to UTC):

        >>> tz_aware.tz_localize(None)
        DatetimeIndex(['2018-03-01 09:00:00', '2018-03-02 09:00:00',
                       '2018-03-03 09:00:00'],
                      dtype='datetime64[ns]', freq=None)

        Be careful with DST changes. When there is sequential data, pandas can
        infer the DST time:

        >>> s = pd.to_datetime(pd.Series(['2018-10-28 01:30:00',
        ...                               '2018-10-28 02:00:00',
        ...                               '2018-10-28 02:30:00',
        ...                               '2018-10-28 02:00:00',
        ...                               '2018-10-28 02:30:00',
        ...                               '2018-10-28 03:00:00',
        ...                               '2018-10-28 03:30:00']))
        >>> s.dt.tz_localize('CET', ambiguous='infer')
        0   2018-10-28 01:30:00+02:00
        1   2018-10-28 02:00:00+02:00
        2   2018-10-28 02:30:00+02:00
        3   2018-10-28 02:00:00+01:00
        4   2018-10-28 02:30:00+01:00
        5   2018-10-28 03:00:00+01:00
        6   2018-10-28 03:30:00+01:00
        dtype: datetime64[ns, CET]

        In some cases, inferring the DST is impossible. In such cases, you can
        pass an ndarray to the ambiguous parameter to set the DST explicitly

        >>> s = pd.to_datetime(pd.Series(['2018-10-28 01:20:00',
        ...                               '2018-10-28 02:36:00',
        ...                               '2018-10-28 03:46:00']))
        >>> s.dt.tz_localize('CET', ambiguous=np.array([True, True, False]))
        0   2018-10-28 01:20:00+02:00
        1   2018-10-28 02:36:00+02:00
        2   2018-10-28 03:46:00+01:00
        dtype: datetime64[ns, CET]

        If the DST transition causes nonexistent times, you can shift these
        dates forward or backwards with a timedelta object or `'shift_forward'`
        or `'shift_backwards'`.

        >>> s = pd.to_datetime(pd.Series(['2015-03-29 02:30:00',
        ...                               '2015-03-29 03:30:00']))
        >>> s.dt.tz_localize('Europe/Warsaw', nonexistent='shift_forward')
        0   2015-03-29 03:00:00+02:00
        1   2015-03-29 03:30:00+02:00
        dtype: datetime64[ns, Europe/Warsaw]

        >>> s.dt.tz_localize('Europe/Warsaw', nonexistent='shift_backward')
        0   2015-03-29 01:59:59.999999999+01:00
        1   2015-03-29 03:30:00+02:00
        dtype: datetime64[ns, Europe/Warsaw]

        >>> s.dt.tz_localize('Europe/Warsaw', nonexistent=pd.Timedelta('1h'))
        0   2015-03-29 03:30:00+02:00
        1   2015-03-29 03:30:00+02:00
        dtype: datetime64[ns, Europe/Warsaw]
        )r�r
�
shift_forward�shift_backwardzoThe nonexistent argument must be one of 'raise', 'NaT', 'shift_forward', 'shift_backward' or a timedelta objectNrVz,Already tz-aware, use tz_convert to convert.r�rKrLr�r�rr>)r}rr�rCrr&rdr?rr�rrrrDrFr�rr,r_r�)	rirCr�r��nonexistent_options�	new_dates�new_dates_dt64rNr_s	         rEr�zDatetimeArray.tz_localize�s4��dR���1�1�*���;
��%��
��7�7���z�/��	�	�4�7�7����U�	�� N�O�O��'�'��+�B�%�7�7��	�	��#�'��k�k��I�#���#�d�i�i�[��(:�;���B�T�Y�Y�/�������B��C��I��N�4��q�@Q�;R��9�9�D�
�Z�D�G�G�O��9�9�D�����e�$��G�GrHc�Z�t|j|j|j��S)a�
        Return an ndarray of ``datetime.datetime`` objects.

        Returns
        -------
        numpy.ndarray

        Examples
        --------
        >>> idx = pd.date_range('2018-02-27', periods=3)
        >>> idx.to_pydatetime()
        array([datetime.datetime(2018, 2, 27, 0, 0),
               datetime.datetime(2018, 2, 28, 0, 0),
               datetime.datetime(2018, 3, 1, 0, 0)], dtype=object)
        )rCrW�rr&rCrdr�s rE�
to_pydatetimezDatetimeArray.to_pydatetimeWs�� "�$�)�)����d�k�k�J�JrHc�d�t|j|j|j��}|j	|j
j�}t|�j||j��}|jd�}|j�|j|j�}|S)a�
        Convert times to midnight.

        The time component of the date-time is converted to midnight i.e.
        00:00:00. This is useful in cases, when the time does not matter.
        Length is unaltered. The timezones are unaffected.

        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on Datetime Array/Index.

        Returns
        -------
        DatetimeArray, DatetimeIndex or Series
            The same type as the original data. Series will have the same
            name and index. DatetimeIndex will have the same name.

        See Also
        --------
        floor : Floor the datetimes to the specified freq.
        ceil : Ceil the datetimes to the specified freq.
        round : Round the datetimes to the specified freq.

        Examples
        --------
        >>> idx = pd.date_range(start='2014-08-01 10:00', freq='h',
        ...                     periods=3, tz='Asia/Calcutta')
        >>> idx
        DatetimeIndex(['2014-08-01 10:00:00+05:30',
                       '2014-08-01 11:00:00+05:30',
                       '2014-08-01 12:00:00+05:30'],
                        dtype='datetime64[ns, Asia/Calcutta]', freq='h')
        >>> idx.normalize()
        DatetimeIndex(['2014-08-01 00:00:00+05:30',
                       '2014-08-01 00:00:00+05:30',
                       '2014-08-01 00:00:00+05:30'],
                       dtype='datetime64[ns, Asia/Calcutta]', freq=None)
        rVr��infer)rr&rCrdrrArNrBr��
_with_freqr�)ri�
new_valuesr�dtas    rEr�zDatetimeArray.normalizeis���L-�T�Y�Y����d�k�k�R�
� �o�o�d�m�m�&9�&9�:���4�j�$�$�[��8I�8I�$�J���n�n�W�%���7�7���/�/�$�'�'�*�C��
rHc���ddlm}|j�$tjdt
t
���|��|jxs|j}t|jt�r5t|jd�rt|j�j}|�td��t!|�}|�|}|}|j"|j$||j��S)a�
        Cast to PeriodArray/PeriodIndex at a particular frequency.

        Converts DatetimeArray/Index to PeriodArray/PeriodIndex.

        Parameters
        ----------
        freq : str or Period, optional
            One of pandas' :ref:`period aliases <timeseries.period_aliases>`
            or an Period object. Will be inferred by default.

        Returns
        -------
        PeriodArray/PeriodIndex

        Raises
        ------
        ValueError
            When converting a DatetimeArray/Index with non-regular values,
            so that a frequency cannot be inferred.

        See Also
        --------
        PeriodIndex: Immutable ndarray holding ordinal values.
        DatetimeIndex.to_pydatetime: Return DatetimeIndex as object.

        Examples
        --------
        >>> df = pd.DataFrame({"y": [1, 2, 3]},
        ...                   index=pd.to_datetime(["2000-03-31 00:00:00",
        ...                                         "2000-05-31 00:00:00",
        ...                                         "2000-08-31 00:00:00"]))
        >>> df.index.to_period("M")
        PeriodIndex(['2000-03', '2000-05', '2000-08'],
                    dtype='period[M]')

        Infer the daily frequency

        >>> idx = pd.date_range("2017-01-01", periods=2)
        >>> idx.to_period()
        PeriodIndex(['2017-01-01', '2017-01-02'],
                    dtype='period[D]')
        rr=zNConverting to PeriodArray/Index representation will drop timezone information.rV�_period_dtype_codez8You must pass a freq argument as current index has none.r)�pandas.core.arraysr>rCr[r\�UserWarningr!rcr�r}r_rrOr+�_freqstrr�r/�_from_datetime64rA)rir_r>�ress    rEr�zDatetimeArray.to_period�s���X	3��7�7���M�M�2��+�-�	
��<��<�<�5�4�#5�#5�D��$�)�)�Z�0�W��	�	�/�6�#�4�9�9�-�6�6���|� �N���#�4�(�C��{����D�+�{�+�+�D�M�M�4�D�G�G�L�LrHc��|j�}tj|d||j��}|j	|d��}|S)u�
        Return the month names with specified locale.

        Parameters
        ----------
        locale : str, optional
            Locale determining the language in which to return the month name.
            Default is English locale (``'en_US.utf8'``). Use the command
            ``locale -a`` on your terminal on Unix systems to find your locale
            language code.

        Returns
        -------
        Series or Index
            Series or Index of month names.

        Examples
        --------
        >>> s = pd.Series(pd.date_range(start='2018-01', freq='ME', periods=3))
        >>> s
        0   2018-01-31
        1   2018-02-28
        2   2018-03-31
        dtype: datetime64[ns]
        >>> s.dt.month_name()
        0     January
        1    February
        2       March
        dtype: object

        >>> idx = pd.date_range(start='2018-01', freq='ME', periods=3)
        >>> idx
        DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31'],
                      dtype='datetime64[ns]', freq='ME')
        >>> idx.month_name()
        Index(['January', 'February', 'March'], dtype='object')

        Using the ``locale`` parameter you can set a different locale language,
        for example: ``idx.month_name(locale='pt_BR.utf8')`` will return month
        names in Brazilian Portuguese language.

        >>> idx = pd.date_range(start='2018-01', freq='ME', periods=3)
        >>> idx
        DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31'],
                      dtype='datetime64[ns]', freq='ME')
        >>> idx.month_name(locale='pt_BR.utf8')  # doctest: +SKIP
        Index(['Janeiro', 'Fevereiro', 'Março'], dtype='object')
        r���localerWNrX�r\rrgrdrh�rirwrjrls    rEr�zDatetimeArray.month_name�sL��b�'�'�)���+�+��L��d�k�k�
���)�)�&�T�)�B���
rHc��|j�}tj|d||j��}|j	|d��}|S)u�
        Return the day names with specified locale.

        Parameters
        ----------
        locale : str, optional
            Locale determining the language in which to return the day name.
            Default is English locale (``'en_US.utf8'``). Use the command
            ``locale -a`` on your terminal on Unix systems to find your locale
            language code.

        Returns
        -------
        Series or Index
            Series or Index of day names.

        Examples
        --------
        >>> s = pd.Series(pd.date_range(start='2018-01-01', freq='D', periods=3))
        >>> s
        0   2018-01-01
        1   2018-01-02
        2   2018-01-03
        dtype: datetime64[ns]
        >>> s.dt.day_name()
        0       Monday
        1      Tuesday
        2    Wednesday
        dtype: object

        >>> idx = pd.date_range(start='2018-01-01', freq='D', periods=3)
        >>> idx
        DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
                      dtype='datetime64[ns]', freq='D')
        >>> idx.day_name()
        Index(['Monday', 'Tuesday', 'Wednesday'], dtype='object')

        Using the ``locale`` parameter you can set a different locale language,
        for example: ``idx.day_name(locale='pt_BR.utf8')`` will return day
        names in Brazilian Portuguese language.

        >>> idx = pd.date_range(start='2018-01-01', freq='D', periods=3)
        >>> idx
        DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
                      dtype='datetime64[ns]', freq='D')
        >>> idx.day_name(locale='pt_BR.utf8') # doctest: +SKIP
        Index(['Segunda', 'Terça', 'Quarta'], dtype='object')
        r�rvNrXrxrys    rEr�zDatetimeArray.day_namesL��b�'�'�)���+�+��J�v�D�K�K�
���)�)�&�T�)�B���
rHc�R�|j�}t|d|j��S)a�
        Returns numpy array of :class:`datetime.time` objects.

        The time part of the Timestamps.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.time
        0    10:00:00
        1    11:00:00
        dtype: object

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.time
        array([datetime.time(10, 0), datetime.time(11, 0)], dtype=object)
        r��r/rW�r\rrd�ri�
timestampss  rEr�zDatetimeArray.timeXs&��@�+�+�-�
�!�*�&�t�{�{�K�KrHc�\�t|j|jd|j��S)aQ
        Returns numpy array of :class:`datetime.time` objects with timezones.

        The time part of the Timestamps.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.timetz
        0    10:00:00+00:00
        1    11:00:00+00:00
        dtype: object

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.timetz
        array([datetime.time(10, 0, tzinfo=datetime.timezone.utc),
        datetime.time(11, 0, tzinfo=datetime.timezone.utc)], dtype=object)
        r�r|rgr�s rEr�zDatetimeArray.timetz|s!��<"�$�)�)�T�W�W�&�t�{�{�S�SrHc�R�|j�}t|d|j��S)a5
        Returns numpy array of python :class:`datetime.date` objects.

        Namely, the date part of Timestamps without time and
        timezone information.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.date
        0    2020-01-01
        1    2020-02-01
        dtype: object

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.date
        array([datetime.date(2020, 1, 1), datetime.date(2020, 2, 1)], dtype=object)
        r�r|r}r~s  rEr�zDatetimeArray.date�s&��B�+�+�-�
�!�*�&�t�{�{�K�KrHc���ddlm}|j�}tj||j
��}||gd�d��}|jrd|j|j<|S)a�
        Calculate year, week, and day according to the ISO 8601 standard.

        Returns
        -------
        DataFrame
            With columns year, week and day.

        See Also
        --------
        Timestamp.isocalendar : Function return a 3-tuple containing ISO year,
            week number, and weekday for the given Timestamp object.
        datetime.date.isocalendar : Return a named tuple object with
            three components: year, week and weekday.

        Examples
        --------
        >>> idx = pd.date_range(start='2019-12-29', freq='D', periods=4)
        >>> idx.isocalendar()
                    year  week  day
        2019-12-29  2019    52    7
        2019-12-30  2020     1    1
        2019-12-31  2020     1    2
        2020-01-01  2020     1    3
        >>> idx.isocalendar().week
        2019-12-29    52
        2019-12-30     1
        2019-12-31     1
        2020-01-01     1
        Freq: D, Name: week, dtype: UInt32
        rr;rV)r��weekr��UInt32)�columnsrNN)	�pandasr<r\r�build_isocalendar_sarrayrd�_hasna�iloc�_isnan)rir<rj�sarray�iso_calendar_dfs     rE�isocalendarzDatetimeArray.isocalendar�sa��@	%��'�'�)���0�0��d�k�k�J��#��3�8�
���;�;�04�O� � ����-��rHr��Ya�
        The year of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="YE")
        ... )
        >>> datetime_series
        0   2000-12-31
        1   2001-12-31
        2   2002-12-31
        dtype: datetime64[ns]
        >>> datetime_series.dt.year
        0    2000
        1    2001
        2    2002
        dtype: int32
        rUr{a�
        The month as January=1, December=12.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="ME")
        ... )
        >>> datetime_series
        0   2000-01-31
        1   2000-02-29
        2   2000-03-31
        dtype: datetime64[ns]
        >>> datetime_series.dt.month
        0    1
        1    2
        2    3
        dtype: int32
        r��Da�
        The day of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="D")
        ... )
        >>> datetime_series
        0   2000-01-01
        1   2000-01-02
        2   2000-01-03
        dtype: datetime64[ns]
        >>> datetime_series.dt.day
        0    1
        1    2
        2    3
        dtype: int32
        r��ha�
        The hours of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="h")
        ... )
        >>> datetime_series
        0   2000-01-01 00:00:00
        1   2000-01-01 01:00:00
        2   2000-01-01 02:00:00
        dtype: datetime64[ns]
        >>> datetime_series.dt.hour
        0    0
        1    1
        2    2
        dtype: int32
        r��ma�
        The minutes of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="min")
        ... )
        >>> datetime_series
        0   2000-01-01 00:00:00
        1   2000-01-01 00:01:00
        2   2000-01-01 00:02:00
        dtype: datetime64[ns]
        >>> datetime_series.dt.minute
        0    0
        1    1
        2    2
        dtype: int32
        r�r�a�
        The seconds of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="s")
        ... )
        >>> datetime_series
        0   2000-01-01 00:00:00
        1   2000-01-01 00:00:01
        2   2000-01-01 00:00:02
        dtype: datetime64[ns]
        >>> datetime_series.dt.second
        0    0
        1    1
        2    2
        dtype: int32
        r�r�a�
        The microseconds of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="us")
        ... )
        >>> datetime_series
        0   2000-01-01 00:00:00.000000
        1   2000-01-01 00:00:00.000001
        2   2000-01-01 00:00:00.000002
        dtype: datetime64[ns]
        >>> datetime_series.dt.microsecond
        0       0
        1       1
        2       2
        dtype: int32
        r�a�
        The nanoseconds of the datetime.

        Examples
        --------
        >>> datetime_series = pd.Series(
        ...     pd.date_range("2000-01-01", periods=3, freq="ns")
        ... )
        >>> datetime_series
        0   2000-01-01 00:00:00.000000000
        1   2000-01-01 00:00:00.000000001
        2   2000-01-01 00:00:00.000000002
        dtype: datetime64[ns]
        >>> datetime_series.dt.nanosecond
        0       0
        1       1
        2       2
        dtype: int32
        a�
    The day of the week with Monday=0, Sunday=6.

    Return the day of the week. It is assumed the week starts on
    Monday, which is denoted by 0 and ends on Sunday which is denoted
    by 6. This method is available on both Series with datetime
    values (using the `dt` accessor) or DatetimeIndex.

    Returns
    -------
    Series or Index
        Containing integers indicating the day number.

    See Also
    --------
    Series.dt.dayofweek : Alias.
    Series.dt.weekday : Alias.
    Series.dt.day_name : Returns the name of the day of the week.

    Examples
    --------
    >>> s = pd.date_range('2016-12-31', '2017-01-08', freq='D').to_series()
    >>> s.dt.dayofweek
    2016-12-31    5
    2017-01-01    6
    2017-01-02    0
    2017-01-03    1
    2017-01-04    2
    2017-01-05    3
    2017-01-06    4
    2017-01-07    5
    2017-01-08    6
    Freq: D, dtype: int32
    r��dowr��doya�
        The ordinal day of the year.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.dayofyear
        0    1
        1   32
        dtype: int32

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.dayofyear
        Index([1, 32], dtype='int32')
        r��qax
        The quarter of the date.

        Examples
        --------
        For Series:

        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "4/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-04-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.quarter
        0    1
        1    2
        dtype: int32

        For DatetimeIndex:

        >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",
        ...                         "2/1/2020 11:00:00+00:00"])
        >>> idx.quarter
        Index([1, 1], dtype='int32')
        r��dima�
        The number of days in the month.

        Examples
        --------
        >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
        >>> s = pd.to_datetime(s)
        >>> s
        0   2020-01-01 10:00:00+00:00
        1   2020-02-01 11:00:00+00:00
        dtype: datetime64[ns, UTC]
        >>> s.dt.daysinmonth
        0    31
        1    29
        dtype: int32
        a�
        Indicates whether the date is the {first_or_last} day of the month.

        Returns
        -------
        Series or array
            For Series, returns a Series with boolean values.
            For DatetimeIndex, returns a boolean array.

        See Also
        --------
        is_month_start : Return a boolean indicating whether the date
            is the first day of the month.
        is_month_end : Return a boolean indicating whether the date
            is the last day of the month.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> s = pd.Series(pd.date_range("2018-02-27", periods=3))
        >>> s
        0   2018-02-27
        1   2018-02-28
        2   2018-03-01
        dtype: datetime64[ns]
        >>> s.dt.is_month_start
        0    False
        1    False
        2    True
        dtype: bool
        >>> s.dt.is_month_end
        0    False
        1    True
        2    False
        dtype: bool

        >>> idx = pd.date_range("2018-02-27", periods=3)
        >>> idx.is_month_start
        array([False, False, True])
        >>> idx.is_month_end
        array([False, True, False])
    r��first)�
first_or_lastr��lastr�a�
        Indicator for whether the date is the first day of a quarter.

        Returns
        -------
        is_quarter_start : Series or DatetimeIndex
            The same type as the original data with boolean values. Series will
            have the same name and index. DatetimeIndex will have the same
            name.

        See Also
        --------
        quarter : Return the quarter of the date.
        is_quarter_end : Similar property for indicating the quarter end.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30",
        ...                   periods=4)})
        >>> df.assign(quarter=df.dates.dt.quarter,
        ...           is_quarter_start=df.dates.dt.is_quarter_start)
               dates  quarter  is_quarter_start
        0 2017-03-30        1             False
        1 2017-03-31        1             False
        2 2017-04-01        2              True
        3 2017-04-02        2             False

        >>> idx = pd.date_range('2017-03-30', periods=4)
        >>> idx
        DatetimeIndex(['2017-03-30', '2017-03-31', '2017-04-01', '2017-04-02'],
                      dtype='datetime64[ns]', freq='D')

        >>> idx.is_quarter_start
        array([False, False,  True, False])
        r�a�
        Indicator for whether the date is the last day of a quarter.

        Returns
        -------
        is_quarter_end : Series or DatetimeIndex
            The same type as the original data with boolean values. Series will
            have the same name and index. DatetimeIndex will have the same
            name.

        See Also
        --------
        quarter : Return the quarter of the date.
        is_quarter_start : Similar property indicating the quarter start.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30",
        ...                    periods=4)})
        >>> df.assign(quarter=df.dates.dt.quarter,
        ...           is_quarter_end=df.dates.dt.is_quarter_end)
               dates  quarter    is_quarter_end
        0 2017-03-30        1             False
        1 2017-03-31        1              True
        2 2017-04-01        2             False
        3 2017-04-02        2             False

        >>> idx = pd.date_range('2017-03-30', periods=4)
        >>> idx
        DatetimeIndex(['2017-03-30', '2017-03-31', '2017-04-01', '2017-04-02'],
                      dtype='datetime64[ns]', freq='D')

        >>> idx.is_quarter_end
        array([False,  True, False, False])
        r�a~
        Indicate whether the date is the first day of a year.

        Returns
        -------
        Series or DatetimeIndex
            The same type as the original data with boolean values. Series will
            have the same name and index. DatetimeIndex will have the same
            name.

        See Also
        --------
        is_year_end : Similar property indicating the last day of the year.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> dates = pd.Series(pd.date_range("2017-12-30", periods=3))
        >>> dates
        0   2017-12-30
        1   2017-12-31
        2   2018-01-01
        dtype: datetime64[ns]

        >>> dates.dt.is_year_start
        0    False
        1    False
        2    True
        dtype: bool

        >>> idx = pd.date_range("2017-12-30", periods=3)
        >>> idx
        DatetimeIndex(['2017-12-30', '2017-12-31', '2018-01-01'],
                      dtype='datetime64[ns]', freq='D')

        >>> idx.is_year_start
        array([False, False,  True])
        r�a{
        Indicate whether the date is the last day of the year.

        Returns
        -------
        Series or DatetimeIndex
            The same type as the original data with boolean values. Series will
            have the same name and index. DatetimeIndex will have the same
            name.

        See Also
        --------
        is_year_start : Similar property indicating the start of the year.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> dates = pd.Series(pd.date_range("2017-12-30", periods=3))
        >>> dates
        0   2017-12-30
        1   2017-12-31
        2   2018-01-01
        dtype: datetime64[ns]

        >>> dates.dt.is_year_end
        0    False
        1     True
        2    False
        dtype: bool

        >>> idx = pd.date_range("2017-12-30", periods=3)
        >>> idx
        DatetimeIndex(['2017-12-30', '2017-12-31', '2018-01-01'],
                      dtype='datetime64[ns]', freq='D')

        >>> idx.is_year_end
        array([False,  True, False])
        r�a�
        Boolean indicator if the date belongs to a leap year.

        A leap year is a year, which has 366 days (instead of 365) including
        29th of February as an intercalary day.
        Leap years are years which are multiples of four with the exception
        of years divisible by 100 but not by 400.

        Returns
        -------
        Series or ndarray
             Booleans indicating if dates belong to a leap year.

        Examples
        --------
        This method is available on Series with datetime values under
        the ``.dt`` accessor, and directly on DatetimeIndex.

        >>> idx = pd.date_range("2012-01-01", "2015-01-01", freq="YE")
        >>> idx
        DatetimeIndex(['2012-12-31', '2013-12-31', '2014-12-31'],
                      dtype='datetime64[ns]', freq='YE-DEC')
        >>> idx.is_leap_year
        array([ True, False, False])

        >>> dates_series = pd.Series(idx)
        >>> dates_series
        0   2012-12-31
        1   2013-12-31
        2   2014-12-31
        dtype: datetime64[ns]
        >>> dates_series.dt.is_leap_year
        0     True
        1    False
        2    False
        dtype: bool
        c��tj|j�}tj|j�}tj|j�}|dk}||xxdzcc<||xxdz
cc<|tj
d|zdz
dz�zd|zztj|dz�ztj|d	z�z
tj|d
z�zdz|j|jdzz|jd
zz|jd
zdzz|jd
zdzzdzzS)z�
        Convert Datetime Array to float64 ndarray of Julian Dates.
        0 Julian date is noon January 1, 4713 BC.
        https://en.wikipedia.org/wiki/Julian_day
        r�r�rS�i��im��di�g�C:A�<ii@Biʚ;�)rM�asarrayr�rUr��fixr�r�r�r�r�r�)rir�rUr��testarrs     rE�to_julian_datezDatetimeArray.to_julian_date$sM���z�z�$�)�)�$���
�
�4�:�:�&���j�j����"���!�)���W�
���
�
�g��"�����f�f�c�E�k�C�'�1�,�-�
.��D�j�
��h�h�t�a�x� �
!��h�h�t�c�z�"�	
#�
�h�h�t�c�z�"�
#��

��	�	��+�+��"�#��+�+��$�%��"�"�T�)�E�1�2��/�/�D�(�5�0�	1���
�	
rHc��ddlm}|jjjjdd�}t
j|�}|j|jj|�|��}	|	j|||||��S)a
        Return sample standard deviation over requested axis.

        Normalized by `N-1` by default. This can be changed using ``ddof``.

        Parameters
        ----------
        axis : int, optional
            Axis for the function to be applied on. For :class:`pandas.Series`
            this parameter is unused and defaults to ``None``.
        ddof : int, default 1
            Degrees of Freedom. The divisor used in calculations is `N - ddof`,
            where `N` represents the number of elements.
        skipna : bool, default True
            Exclude NA/null values. If an entire row/column is ``NA``, the result
            will be ``NA``.

        Returns
        -------
        Timedelta

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

        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[ns]', freq='D')
        >>> idx.std()
        Timedelta('1 days 00:00:00')
        r)�TimedeltaArrayr��timedelta64r�)�axis�out�ddof�keepdimsr�)
rpr�rArNrr�replacerMr�r�std)
rir�rNr�r�r�r�r��	dtype_str�tdas
          rEr�zDatetimeArray.stdGsx��d	6��M�M�'�'�,�,�4�4�\�=�Q�	�����#���(�(����);�);�E�)B�%�(�P���w�w�D�c��x�PV�w�W�WrH)�returnztype[Timestamp])rNr5r�r7)rjznpt.NDArray[np.datetime64]r_r�rNr�r�r7)r��bool)r�r�r_z'str | BaseOffset | lib.NoDefault | Noner�r�r�r�r�r8r�r7)NFr�r��both)r��
int | Noner�r�r�r8r�r9rr6rD�
str | Noner�r7)r��
np.datetime64)r��Timestamp | NaTType)r��None)r~r�r�r�)r�r�)r��
tzinfo | None)r�r�)r�r)NN)r��
np.ndarray)r�r2)T)rFzstr | floatr��npt.NDArray[np.object_])r�rr�r7)r�znpt.NDArray[np.int64])r�r7)r�r�)r�r8r�r9r�r7)r�r�r@)r�r>)r�r<)r�znpt.NDArray[np.float64])NNNr�FT)r�rr�r�r�r�)_ro�
__module__�__qualname__rp�_typrMr��_internal_fill_valuer�_recognized_scalars�_is_recognized_dtype�_infer_matchesrqr�r]�__annotations__rfr�r�r�r��__array_priority__r�r#�_default_dtype�classmethodr�r�r�r�r
r�r�r�rrrrrNrC�setterrr'r)r,r;rrMrRrr]r\r�r��ravel_compatr�rhr�r�r�r�r�r�r�r�rtr�rUr�r�r�r�r�r��_dayofweek_docr�r�r�r�r�r�r�r��
_is_month_docrIr�r�r�r�r�r�r�r�r��
__classcell__)r�s@rErvrv�s(���(�T�D�(�2�=�=���5��#�R�]�]�3����8�N�
�����I�y��%�d�^�K��+��J�	��$7�J�	�6��[� �9�,�z�9�V�H�D��y��(��9��$��

6�5�#�E��#�!�N��8��8������#'�;G�	�*�� ��9�	�

����(�.2��N��N��
���>�>�8;�����#*�A�
�A�6�A��A��A�!�A�
�A��A�F���#*�'.�(.�zD� �zD��	zD��zD�!�zD�%�zD�&�zD��zD�
�zD��zD�~1�,�/����	��*�/��/�@�Y�Y�
��
������N��N��D��D�9�%�:AD�N(-�$�	
�$�	
�	 �	
�	;��0%�T
I�JL�X	���$+�'.�	vH�!�vH�%�	vH�

�vH��vH�vK�$-�^IM�\7�r7�r�!L��!L�F�T��T�>�"L��"L�H)�V���	��D�.
���	�
�E�.�
��	��C�.���	��D�.���	��F�.���	��F�."���	��K�.!���	��J�.!�N�D"�-���G�K��I��G�!��
�	��K�:�I����	��G�:$��
�	��M�( �K�+�M�X%��*�M�,@�,@�w�,@�,W��N�#���
�(<�(<�6�(<�(R��L�'���%	�)��T%���%	�)�N�T$���'	�+�M�X"���'	�+�K�X#���$	�(�L�T
�J������:X�
�:X��
:X��:XrHrvFr�r�c	��t|||��\}}t|dd�}|�d}tjd|�d��}|tk(st|�r�t
tj|�}d}tj|d��d	k(r |jtj�}n�|�G|d
k(rBtj|t��}	tj|	|||t|���}
|
|fSt!|||d|xsd�
�\}}d}|r|r|}
|
|fS|r|}|}
|
|fSt#||||��\}
}
|
|fS|j}t%|t&�r3t
t(|�}t+||j,�}|j.}
n�tj0|d�rIt%|t(�r|j.}t
tj|�}t#||||��\}
}na|jt2k7r#|jtjd��}d}t
tj|�}|j5|�}
|r|
j7�}
t%|
tj�sJt9|
���|
jj:dk(sJ�|
jdk7sJ�t=|
j�sJ�|
|fS)aQ
    Parameters
    ----------
    data : np.ndarray or ExtensionArray
        dtl.ensure_arraylike_for_datetimelike has already been called.
    copy : bool, default False
    tz : tzinfo or None, default None
    dayfirst : bool, default False
    yearfirst : bool, default False
    ambiguous : str, bool, or arraylike, default 'raise'
        See pandas._libs.tslibs.tzconversion.tz_localize_to_utc.
    out_unit : str or None, default None
        Desired output resolution.

    Returns
    -------
    result : numpy.ndarray
        The sequence converted to a numpy array with dtype ``datetime64[unit]``.
        Where `unit` is "ns" unless specified otherwise by `out_unit`.
    tz : tzinfo or None
        Either the user-provided tzinfo or one inferred from the data.

    Raises
    ------
    TypeError : PeriodDType data is passed
    rrNNrxrKrLFr��integerr�r�)rCr�r�r�)r�r��allow_objectr�)rCr�r�r{r=�M8)�maybe_convert_dtyper!rMrNr+r'rr�r
r�rr�r�r�array_to_datetime_with_tzr�objects_to_datetime64�_construct_from_dt64_naiver}r)rv�_maybe_infer_tzrCrAr|r$rr�rBr�r)r�r�rCr�r�r�r�r��	out_dtype�obj_datarlr:�inferred_tz�_s              rEr�r��s���L%�T�4�B�7�J�D�$���w��-�J��������3�x�j��*�+�I��V���z�:��B�J�J��%�����?�?�4��.�)�;��;�;�r�x�x�(�D�
�^�	�W� 4��z�z�$�f�5�H��4�4���!�#�(��2��F��2�:��%:��!�#�"�!�)�T�&�"�I�{��D��k�#���2�:��� ��"���2�:��7��"�4�9��	����2�:���Z�Z�
��*�o�.��M�4�(��
�R����
)������	����S�	)��d�M�*��=�=�D��B�J�J��%��1��R�d�i�
�����:�:��$��;�;�r�x�x�e�;�4�D��D��B�J�J��%�����9�%���������f�b�j�j�)�7�4��<�7�)��<�<����#�#�#��<�<�4�����f�l�l�+�+�+��2�:�rHc�X�|j}t|�st|�}t||d��}d}|jjdk(r8|j|jj
d��}|j}d}|��|j}|jdkDr|j�}t|�}tj|jd�|||��}|j|�}|j|�}|j|k(sJ|j��|}||fS)zP
    Convert datetime64 data to a supported dtype, localizing if necessary.
    Fr��>�<r�r�)r�r�)rNrrr�	byteorderr�newbyteorder�shaper0�ravelrrrr�reshape)r�rCr�r��	new_dtyper�r�rls        rEr�r�	s
���
�
�I��i�(�'�	�2�	�"�4�y�u�E�����z�z���s�"��{�{�4�:�:�2�2�3�7�8���J�J�	���	�~��
�
���9�9�q�=��:�:�<�D�'�	�2�	��.�.��I�I�d�O�R�9�I�
���y�y��#���|�|�E�"���:�:��"�.�D�J�J�.�"�
�F��4�<�rHc
�J�|dvsJ�tj|tj��}tj|||||t|���\}}|�||fS|jjdk(r||fS|jtk(r|r||fStd��t|��)a|
    Convert data to array of timestamps.

    Parameters
    ----------
    data : np.ndarray[object]
    dayfirst : bool
    yearfirst : bool
    utc : bool, default False
        Whether to convert/localize timestamps to UTC.
    errors : {'raise', 'ignore', 'coerce'}
    allow_object : bool
        Whether to return an object-dtype ndarray instead of raising if the
        data contains more than one timezone.
    out_unit : str, default "ns"

    Returns
    -------
    result : ndarray
        np.datetime64[out_unit] if returned values represent wall times or UTC
        timestamps.
        object if mixed timezones
    inferred_tz : tzinfo or None
        If not None, then the datetime64 values in `result` denote UTC timestamps.

    Raises
    ------
    ValueError : if data cannot be converted to datetimes
    TypeError  : When a type cannot be converted to datetime
    )r��ignore�coercer�)�errors�utcr�r�r�r{z!DatetimeIndex has mixed timezones)
rMr��object_r�array_to_datetimerrNr�r+r?)	r�r�r�r�r�r�r�rl�	tz_parseds	         rEr�r�2	s���N�2�2�2�2��:�:�d�"�*�*�-�D��/�/������ ��*�
��F�I����y� � �	���	�	�c�	!��y� � �	����	���9�$�$��;�<�<����rHc�D�t|d�s||fSt|j�r*|jt�jd�}d}||fSt
j|jd�st|j�rtd|j�d���t|jt�rtd��t|jt�rAt|jt�s'tj|tj ��}d}||fS)	a\
    Convert data based on dtype conventions, issuing
    errors where appropriate.

    Parameters
    ----------
    data : np.ndarray or pd.Index
    copy : bool
    tz : tzinfo or None, default None

    Returns
    -------
    data : np.ndarray or pd.Index
    copy : bool

    Raises
    ------
    TypeError : PeriodDType data is passed
    rNr�Fr�zdtype z& cannot be converted to datetime64[ns]zFPassing PeriodDtype data is invalid. Use `data.to_timestamp()` insteadr�)rOr&rNrr#rr
r|r%r?r}r+r*r)rMr�r�)r�r�rCs   rEr�r�|	s���(�4��!��T�z���d�j�j�!�
�{�{�<�(�-�-�d�3����&��:��#

������S�	)�]�4�:�:�-F��&�����,R�S�T�T�	�D�J�J��	,��T�
�	
�
�D�J�J��	/�
��
�
�O�9��x�x��B�J�J�/������:�rHc�j�|�|}|S|�	|Stj||�std|�d|����|S)aV
    If a timezone is inferred from data, check that it is compatible with
    the user-provided timezone, if any.

    Parameters
    ----------
    tz : tzinfo or None
    inferred_tz : tzinfo or None

    Returns
    -------
    tz : tzinfo or None

    Raises
    ------
    TypeError : if both timezones are present but do not match
    zdata is already tz-aware z, unable to set specified tz: )rrPr?)rCr�s  rEr�r��	sc��$
�z�
���I�
�	���I��
!�
!�"�k�
2��'��}�5!�!#��
&�
�	
��IrHc���|��t|�}|tjd�k(r
d}t|��t	|tj�r|j
dk7s+t
|�r t	|tjtf�std|�d���t|dd�rDtt|�}t|jtj|j���}|S)	a�
    Check that a dtype, if passed, represents either a numpy datetime64[ns]
    dtype or a pandas DatetimeTZDtype.

    Parameters
    ----------
    dtype : object

    Returns
    -------
    dtype : None, numpy.dtype, or DatetimeTZDtype

    Raises
    ------
    ValueError : invalid dtype

    Notes
    -----
    Unlike _validate_tz_from_dtype, this does _not_ allow non-existent
    tz errors to go through
    Nr�zhPassing in 'datetime64' dtype with no precision is not allowed. Please pass in 'datetime64[ns]' instead.r{zUnexpected value for 'dtype': 'ze'. Must be 'datetime64[s]', 'datetime64[ms]', 'datetime64[us]', 'datetime64[ns]' or DatetimeTZDtype'.rC)rDrC)r(rMrNr�r}r�rr)r!rrDr�tz_standardizerC)rN�msgs  rEr�r��	s���,
���U�#���B�H�H�T�N�"�;�
��S�/�!�
�u�b�h�h�'����s�"�*<�U�*C��E�B�H�H�o�#>�?��1�%��98�8��
��5�$��%���%�0�E�#��Z�Z�I�$<�$<�U�X�X�$F��E��LrHc�l�|��t|t�r	tj|�}t|dd�}|�2|�!t
j||�std��|rtd��|}|�9tj|d�r#|�!t
j||�std��|S#t$rY��wxYw)a�
    If the given dtype is a DatetimeTZDtype, extract the implied
    tzinfo object from it and check that it does not conflict with the given
    tz.

    Parameters
    ----------
    dtype : dtype, str
    tz : None, tzinfo
    explicit_tz_none : bool, default False
        Whether tz=None was passed explicitly, as opposed to lib.no_default.

    Returns
    -------
    tz : consensus tzinfo

    Raises
    ------
    ValueError : on tzinfo mismatch
    NrCz-cannot supply both a tz and a dtype with a tzz3Cannot pass both a timezone-aware dtype and tz=Noner{zHcannot supply both a tz and a timezone-naive dtype (i.e. datetime64[ns]))r}r@r)�construct_from_stringr?r!rrPr�r
r|)rNrCr��dtzs    rEr�r�

s���.
���e�S�!�
�'�=�=�e�D���e�T�4�(���?��~�i�&:�&:�2�s�&C� �!P�Q�Q�� �!V�W�W��B�
�>�c�o�o�e�S�9��~�i�&:�&:�2�s�&C� �A���
�I��/�
�
�
�s�B'�'	B3�2B3c��	tj||�}tj|�}tj|�}|�%|�#tj
||�std��|S|�|}|S#t$r}td�|�d}~wwxYw)a�
    If a timezone is not explicitly given via `tz`, see if one can
    be inferred from the `start` and `end` endpoints.  If more than one
    of these inputs provides a timezone, require that they all agree.

    Parameters
    ----------
    start : Timestamp
    end : Timestamp
    tz : tzinfo or None

    Returns
    -------
    tz : tzinfo or None

    Raises
    ------
    TypeError : if start and end timezones do not agree
    z>Start and end cannot both be tz-aware with different timezonesNz0Inferred time zone not equal to passed time zone)r�infer_tzinfo�AssertionErrorr?r�rP)rQrRrCr��errs     rEr�r�?
s���,��,�,�U�C�8���(�(��5�K�	�	�	��	#�B�	�~�+�1��#�#�K��4� �!S�T�T�
�I�
�	 �
��
�I��!���L�
��	���s�A/�/	B	�8B�B	c�V�|r$|�|j�}|�|j�}||fSr@)r�)rQrRr�s   rEr�r�j
s3������O�O�%�E��?��-�-�/�C��#�:�rHc��|�D|j�8|dk7r|nd}||dd�}t|t�s|�||d<|jdi|��}|S)a�
    Localize a start or end Timestamp to the timezone of the corresponding
    start or end Timestamp

    Parameters
    ----------
    ts : start or end Timestamp to potentially localize
    freq : Tick, DateOffset, or None
    tz : str, timezone object or None
    ambiguous: str, localization behavior for ambiguous times
    nonexistent: str, localization behavior for nonexistent times

    Returns
    -------
    ts : Timestamp
    NrjF)r�r�rCrCrA)rr}r1r�)rr_rCr�r��
localize_argss      rEr�r�w
s_��,
�~�"�)�)�+�"+�g�!5�I�5�	�&/��SW�X�
��d�D�!�T�\�"$�M�$��
�R�^�^�
,�m�
,��
�IrHc#�TK�t|�}t|�}|tur|j|�}nd}t|�}|tur|j|�}nd}|r#|j	|�s|j|�}n$|r"|j	|�s|j
|�}|�||kr|jdk\rd}d}|�||dz
|zz}|�||dz
|zz
}tt|�}tt|�}|}|jdk\rO||krI|��||k(ry|j|�}|j|�}||krtd|�d���|}||kr�Hyy||k\rI|��||k(ry|j|�}|j|�}||k\rtd|�d���|}||k\r�Hyy�w)a�
    Generates a sequence of dates corresponding to the specified time
    offset. Similar to dateutil.rrule except uses pandas DateOffset
    objects to represent time increments.

    Parameters
    ----------
    start : Timestamp or None
    end : Timestamp or None
    periods : int or None
    offset : DateOffset
    unit : str

    Notes
    -----
    * This method is faster for generating weekdays than dateutil.rrule
    * At least two of (start, end, periods) must be specified.
    * If both start and end are specified, the returned dates will
    satisfy start <= date <= end.

    Returns
    -------
    dates : generator object
    Nrr�zOffset z did not increment datez did not decrement date)rrr
r��is_on_offset�rollforward�rollback�nr�_applyr�)rQrRr�r�rD�cur�	next_dates       rEr�r��
s�����@�v�
�F�
�e��E��C���
�
�d�#�����C�.�C�
�#�~��k�k�$������V�(�(��/��"�"�5�)��	�V�(�(��-��o�o�c�"����3��;�6�8�8�q�=�����
�{��w��{�f�,�,���}��w��{�f�,�,����E�"�E�
�y�#�
�C�
�C�
�x�x�1�}��S�j��I��c�z���
�
�c�*�I�!�)�)�$�/�I��C�� �7�6�(�2I�!J�K�K��C��S�j��S�j��I��c�z���
�
�c�*�I�!�)�)�$�/�I��C�� �7�6�(�2I�!J�K�K��C��S�j�s�EF(�AF(�&F().)rCrrDr@r�r))rCr�rDr@r�znp.dtype[np.datetime64])rx)rCr�rDr@r�r�r@)rrr@rmr@rsr�)r�r3r�r�rCr�r�r�r�r�r�r8r�r�)
r�r�rCr�r�r�r�r8r�ztuple[np.ndarray, bool])Fr�Frx)
r�r�r�r�r�r4r�r�r�r@)r�r�rCr�)rCr�r�r�r�r�)F)rCr�r�r�r�r�)rQrrRrrCr�r�r�)rQ�Timestamp | NonerRr�r�r�)rr�r�r�)
rQr�rRr�r�r�r�rrDr@)e�
__future__rrrr�typingrrr	r[�numpyrM�pandas._libsr
r�pandas._libs.tslibsrr
rrrrrrrrrrrrrrrrr�pandas._libs.tslibs.dtypesr�
pandas.errorsr �pandas.util._exceptionsr!�pandas.util._validatorsr"�pandas.core.dtypes.commonr#r$r%r&r'r(�pandas.core.dtypes.dtypesr)r*r+�pandas.core.dtypes.missingr,rpr-r��pandas.core.arrays._rangesr.�pandas.core.common�core�commonr��pandas.tseries.frequenciesr/�pandas.tseries.offsetsr0r1�collections.abcr2�pandas._typingr3r4r5r6r7r8r9r:r�r<r>r2rFrt�TimelikeOps�DatelikeOpsrvr�r�r�r�r�r�r�r�r�r�r�rArHrE�<module>rs���"���
��
���������*:�,�4�6�����
,�2�=� � �7��
�(�	�	�	�!�.���
��
��
��
��
$(�1��1� �1�.�1�*%�T[X�C�O�O�S�_�_�[X�J?����&��{�
�{��{�	�	{�
�{��
{��{��{�|)�
�)�*�)�26�)�CP�)��)�`�#*���G �
�G �
�	G �

!�G ��
G ��G �T1�p�<5�r8=�2��2�04�2��2�j(��(�$�(�*7�(��(�V
��
�"2�
�?C�
������Bl��l�	�l��l�
�	l��
lrH

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists