
    Mh                       S SK Jr  S SKrS SKrS SKJr  S SKrS SKr	S SK
r
S SKJrJrJrJrJr  S SKJrJrJrJrJrJr  S SKJr  S SKJrJr  S SKJr  S S	K J!r!  S S
K"J#r#  S SK$J%r%  S SK&J'r'  S SK(J)r)J*r*  S SK+J,s  J-r.  S SK/J0r0J1r1  S SK2J3r3  S SK4J5r5  S SK6J7r7  \(       a"  S SK8J9r9  S SK:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrB  S SKCJDrDJErE  S SKFJGrG  S rH\5" \)R                  \)R                   V s/ s H  n U S;  d  M  U PM     sn -   \)SS9\5" S/\)SS9\5" / SQ\)R                  -   \)5       " S S\35      5       5       5       rL        S#SS.         S$S  jjjrM          S%           S&S! jjrNS'S" jrOgs  sn f )(    )annotationsN)TYPE_CHECKING)NaTPeriod	Timestampindexlib)
ResolutionTick	Timedeltaperiods_per_day	timezones	to_offset)prefix_mapping)cache_readonlydoc)find_stack_level)	is_scalar)DatetimeTZDtype)	ABCSeries)is_valid_na_for_dtype)DatetimeArraytz_to_dtype)Indexmaybe_extract_name)DatetimeTimedeltaMixin)inherit_names)to_time)Hashable)DtypeDtypeObj	FrequencyIntervalClosedTypeSelfTimeAmbiguousTimeNonexistentnpt)	DataFramePeriodIndex)OFFSET_TO_PERIOD_FREQSTRc                Z   SU;   a  [        US   [        5      (       d  UR                  S5      n[        U[        5      (       dB  UR                  S5      nUR                  S5      n[        R                  " U[        U5      US9nO6UnS H.  nXa;   d  M
  X   [        XV5      :X  d   eUR                  U5        M0     U R                  " U40 UD6nU$ [        R                  " 5          [        R                  " S5        U R                  " U 40 UD6nSSS5        U$ ! , (       d  f       W$ = f)zi
This is called upon unpickling, rather than the default which doesn't
have arguments and breaks __new__
datatzfreq)dtyper.   )r-   r.   ignoreN)
isinstanceDatetimeIndexpopr   _simple_newr   getattrwarningscatch_warningssimplefilter__new__)clsdr,   r-   r.   dtakeyresults           O/var/www/html/env/lib/python3.13/site-packages/pandas/core/indexes/datetimes.py_new_DatetimeIndexr@   I   s   
 {:ai??uuV}$.. tB55=D++DBdSCC% 86WS%6666EE#J & ** M $$& !!(+[[**F	 ' M '& Ms   '*D
D*)tz_localize
tz_convertstrftimeT)wrapis_normalized)cache)r-   tzinfor/   to_pydatetimedatetimetimetzstdc                  ^  ^  \ rS rSr% SrSr\rSr\	S'S j5       r
S\S'   S\S'   S	\S
'   \" \R                  5      S(S j5       r\" \R                  5      S)S j5       r\" \R                  5        S*     S+S jj5       r\" \R                   5      S,S-S jj5       r\" \R"                  5      S(S j5       r\" \R$                  5      S.S j5       r\S/S j5       rS\R,                  \R,                  \R,                  \R,                  SSSSSS4                 S0S jjr\S1S j5       rS rS2S jr\S 5       rS1U 4S jjrS3S jrS4S5S jjrS6S jrS7U 4S jjr S8S jr!S  r"\" \#RH                  5      S9U 4S! jj5       r$S:S" jr%\	S;S# j5       r&S<S=S$ jjr' S>     S?S% jjr(S&r)U =r*$ )@r2   j   ay  
Immutable ndarray-like of datetime64 data.

Represented internally as int64, and which can be boxed to Timestamp objects
that are subclasses of datetime and carry metadata.

.. versionchanged:: 2.0.0
    The various numeric date/time attributes (:attr:`~DatetimeIndex.day`,
    :attr:`~DatetimeIndex.month`, :attr:`~DatetimeIndex.year` etc.) now have dtype
    ``int32``. Previously they had dtype ``int64``.

Parameters
----------
data : array-like (1-dimensional)
    Datetime-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.
tz : pytz.timezone or dateutil.tz.tzfile or datetime.tzinfo or str
    Set the Timezone of the data.
normalize : bool, default False
    Normalize start/end dates to midnight before generating date range.

    .. deprecated:: 2.1.0

closed : {'left', 'right'}, optional
    Set whether to include `start` and `end` that are on the
    boundary. The default includes boundary points on either end.

    .. deprecated:: 2.1.0

ambiguous : 'infer', bool-ndarray, 'NaT', 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.
dayfirst : bool, default False
    If True, parse dates in `data` with the day first order.
yearfirst : bool, default False
    If True parse dates in `data` with the year first order.
dtype : numpy.dtype or DatetimeTZDtype or str, default None
    Note that the only NumPy dtype allowed is `datetime64[ns]`.
copy : bool, default False
    Make a copy of input ndarray.
name : label, default None
    Name to be stored in the index.

Attributes
----------
year
month
day
hour
minute
second
microsecond
nanosecond
date
time
timetz
dayofyear
day_of_year
dayofweek
day_of_week
weekday
quarter
tz
freq
freqstr
is_month_start
is_month_end
is_quarter_start
is_quarter_end
is_year_start
is_year_end
is_leap_year
inferred_freq

Methods
-------
normalize
strftime
snap
tz_convert
tz_localize
round
floor
ceil
to_period
to_pydatetime
to_series
to_frame
month_name
day_name
mean
std

See Also
--------
Index : The base pandas Index type.
TimedeltaIndex : Index of timedelta64 data.
PeriodIndex : Index of Period data.
to_datetime : Convert argument to datetime.
date_range : Create a fixed-frequency DatetimeIndex.

Notes
-----
To learn more about the frequency strings, please see `this link
<https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.

Examples
--------
>>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
>>> idx
DatetimeIndex(['2020-01-01 10:00:00+00:00', '2020-02-01 11:00:00+00:00'],
dtype='datetime64[ns, UTC]', freq=None)
datetimeindexTc                "    [         R                  $ N)libindexDatetimeEngineselfs    r?   _engine_typeDatetimeIndex._engine_type	  s    &&&    r   _data_valueszdt.tzinfo | Noner-   c                h    U R                   R                  U5      n[        X R                  [        S9$ )N)namer/   )rY   rC   r   r\   object)rU   date_formatarrs      r?   rC   DatetimeIndex.strftime  s'    jj!!+.Syy77rX   c                    U R                   R                  U5      n[        U 5      R                  X R                  U R
                  S9$ )Nr\   refs)rY   rB   typer4   r\   _references)rU   r-   r_   s      r?   rB   DatetimeIndex.tz_convert  s:    jj##B'Dz%%c		@P@P%QQrX   raisec                ~    U R                   R                  XU5      n[        U 5      R                  X@R                  S9$ Nr\   )rY   rA   rd   r4   r\   )rU   r-   	ambiguousnonexistentr_   s        r?   rA   DatetimeIndex.tz_localize  s6     jj$$RK@Dz%%c		%::rX   Nc                x    SSK Jn  U R                  R                  U5      nUR                  " X0R
                  S9$ )Nr   )r)   rj   )pandas.core.indexes.apir)   rY   	to_periodr4   r\   )rU   r.   r)   r_   s       r?   rp   DatetimeIndex.to_period(  s.    7jj""4(&&s;;rX   c                r    U R                   R                  5       n[        R                  " XR                  S9$ ri   )rY   to_julian_dater   r4   r\   )rU   r_   s     r?   rs   DatetimeIndex.to_julian_date/  s)    jj'')  9955rX   c                X    U R                   R                  5       nUR                  U 5      $ rQ   )rY   isocalendar	set_index)rU   dfs     r?   rv   DatetimeIndex.isocalendar4  s#    ZZ##%||D!!rX   c                .    U R                   R                  $ rQ   )rY   _resolution_objrT   s    r?   r{   DatetimeIndex._resolution_obj9  s    zz)))rX   Fc                   U[         R                  La0  [        R                  " SU R                   S3[
        [        5       S9  U[         R                  La0  [        R                  " SU R                   S3[
        [        5       S9  [        U5      (       a  U R                  U5        [        XU 5      n[        U[        5      (       aO  U[         R                  L a<  U[         R                  L a)  U	c&  U
(       a  UR                  5       nU R                  XS9$ [        R                  " UU	U
UUUUUS9nS nU
(       d'  [        U[        [         45      (       a  UR"                  nU R                  XUS9nU$ )NzThe 'closed' keyword in zD construction is deprecated and will be removed in a future version.)
stacklevelzThe 'normalize' keyword in rj   )r/   copyr-   r.   dayfirst	yearfirstrk   rb   )r	   
no_defaultr6   warn__name__FutureWarningr   r   _raise_scalar_data_errorr   r1   r   r   r4   _from_sequence_not_strictr   r   re   )r:   r,   r.   r-   	normalizeclosedrk   r   r   r/   r   r\   dtarrrc   subarrs                  r?   r9   DatetimeIndex.__new__@  sO    'MM*3<<. 9F F+-	 CNN*MM-cll^ <F F+-	 T??((. "$c2 t]++&cnn$ yy{??4?3377	
 
4%);<<##D=rX   c                    [        U R                  [        5      (       aC  [        U R                  5      nU[        R
                  " SS9-  [        R
                  " SS9:w  a  gU R                  R                  $ )zY
Return a boolean if we are only dates (and don't have a timezone)

Returns
-------
bool
   )daysr   F)r1   r.   r   r   dt	timedeltarZ   _is_dates_only)rU   deltas     r?   r   DatetimeIndex._is_dates_only  sU     dii&&dii(Er||++r||/CC||***rX   c                \    U R                   U R                  S.n[        [        U 5      U4S 4$ )N)r,   r\   )rY   r\   r@   rd   )rU   r;   s     r?   
__reduce__DatetimeIndex.__reduce__  s)    ZZ3!DJ?D88rX   c                j    U R                   b  [        U[        5      $ [        R                  " US5      $ )z6
Can we compare values of the given dtype to our own?
M)r-   r1   r   r	   is_np_dtype)rU   r/   s     r?   _is_comparable_dtype"DatetimeIndex._is_comparable_dtype  s,     77e_55uc**rX   c                <   ^ SSK Jn  U" U R                  S9mU4S j$ )Nr   )get_format_datetime64)is_dates_onlyc                   > ST" U 5       S3$ )N' )x	formatters    r?   <lambda>/DatetimeIndex._formatter_func.<locals>.<lambda>  s    1Yq\N!,rX   )pandas.io.formats.formatr   r   )rU   r   r   s     @r?   _formatter_funcDatetimeIndex._formatter_func  s     	C)8K8KL	,,rX   c                  > U R                   bK  [        R                  " U R                   5      (       d&  [        R                  " U R                   5      (       d  gUR                   bK  [        R                  " UR                   5      (       d&  [        R                  " UR                   5      (       d  g[        TU ]  U5      $ )NF)r-   r   is_utcis_fixed_offsetsuper_can_range_setop)rU   other	__class__s     r?   r   DatetimeIndex._can_range_setop  s     GG$$TWW----dgg66HH $$UXX..--ehh77w'..rX   c                p   U R                   R                  5       n[        U R                   R                  5      nX-  nU R                  S:X  a  US-  nOTU R                  S:X  a  UnOAU R                  S:X  a  US-  nO+U R                  S:X  a  US-  nO[        U R                  5      eSX@R                  '   U$ )zU
Return the number of microseconds since midnight.

Returns
-------
ndarray[int64_t]
nsi  usmss@B )rY   _local_timestampsr   _cresounitNotImplementedError_isnan)rU   valuesppdfracmicross        r?   _get_time_microsDatetimeIndex._get_time_micros  s     --/djj//0|99T\FYY$FYY$D[FYY#I%F%dii00 {{rX   c                l   [        U5      nU R                  R                  5       n[        U 5       Hd  u  p4UnUR	                  U5      (       dC  UR                  U5      nUR                  U5      n[        XV-
  5      [        Xu-
  5      :  a  UnOUnXRU'   Mf     [        R                  X R                  S9$ )a  
Snap time stamps to nearest occurring frequency.

Returns
-------
DatetimeIndex

Examples
--------
>>> idx = pd.DatetimeIndex(['2023-01-01', '2023-01-02',
...                        '2023-02-01', '2023-02-02'])
>>> idx
DatetimeIndex(['2023-01-01', '2023-01-02', '2023-02-01', '2023-02-02'],
dtype='datetime64[ns]', freq=None)
>>> idx.snap('MS')
DatetimeIndex(['2023-01-01', '2023-01-01', '2023-02-01', '2023-02-01'],
dtype='datetime64[ns]', freq=None)
rj   )r   rY   r   	enumerateis_on_offsetrollbackrollforwardabsr2   r4   r\   )rU   r.   r<   ivr   t0t1s           r?   snapDatetimeIndex.snap  s    ( jjoodODAA$$Q'']]1%%%a(qv;RV,AAF $ ((99(==rX   c                T   [         R                  " UR                  UR                  5      n[        X#S9nUR                  UR
                  peUR                  UR                  5      nUR                  UR                  5      nUR                  b  U R                  c  [        S5      eXV4$ )z
Calculate datetime bounds for parsed time string and its resolution.

Parameters
----------
reso : Resolution
    Resolution provided by parsed string.
parsed : datetime
    Datetime from parsed string.

Returns
-------
lower, upper: pd.Timestamp
)r.   zSThe index must be timezone aware when indexing with a date string with a UTC offset)
r*   getattr_abbrevr   
start_timeend_timerA   rG   r-   
ValueError)rU   resoparsedr.   perstartends          r?   _parsed_string_to_bounds&DatetimeIndex._parsed_string_to_bounds	  s     (++D,<,<d>N>NOV'^^S\\s !!&--0oofmm,==$ww ;  zrX   c                   > [         TU ]  U5      u  p#[        U5      nU R                  b(  UR                  c  UR                  U R                  5      nX#4$ rQ   )r   _parse_with_resor   r-   rG   rA   )rU   labelr   r   r   s       r?   r   DatetimeIndex._parse_with_reso.  sO    w/66"776==#8 ''0F|rX   c                x     U R                   R                  U5        g! [         a  n[        U5      UeSnAff = f)zE
Check for mismatched-tzawareness indexing and re-raise as KeyError.
N)rY   _assert_tzawareness_compat	TypeErrorKeyError)rU   r=   errs      r?   _disallow_mismatched_indexing+DatetimeIndex._disallow_mismatched_indexing;  s5    
	)JJ11#6 	)3-S(	)s    
949c                   U R                  U5        Un[        XR                  5      (       a  [        n[	        XR
                  R                  5      (       a  U R                  U5        [        U5      nO[	        U[        5      (       aP   U R                  U5      u  p4U R                  U5        U R                  U5      (       a   U R!                  XC5      $ UnO[	        U["        R$                  5      (       a7  ['        S[)        U 5      R*                   S[)        U5      R*                   35      e[	        U["        R,                  5      (       a  U R/                  U5      $ [        U5      e [0        R2                  " X5      $ ! [        [        R                  4 a  n[        U5      UeSnAff = f! [         a  n[        U5      UeSnAff = f! [         a  n[        U5      UeSnAff = f)zE
Get integer location for requested label

Returns
-------
loc : int
NzCannot index z with )_check_indexing_errorr   r/   r   r1   rY   _recognized_scalarsr   r   strr   r   pytzNonExistentTimeErrorr   _can_partial_date_slice_partial_date_slicer   r   r   rd   r   rJ   indexer_at_timer   get_loc)rU   r=   orig_keyr   r   r   s         r?   r   DatetimeIndex.get_locF  s    	""3' jj11Cc::99::..s3C.CS!!-#44S9 ..v6++D11133DAA CR\\**T
 3 34F49;M;M:NO  RWW%%'',, 3-	.==++5  9 9: -sm,-   1"3-S01(  	.8$#-	.sH   F F0 ,G F-F((F-0
G:GG
G)G$$G)c                  > [        U[        R                  5      (       a8  [        U[        R                  5      (       d  [	        U5      R                  5       n[        TU ]  X5      nU R                  R                  U5        [	        U5      $ rQ   )
r1   r   rI   datetimer   rH   r   _maybe_cast_slice_boundrY   r   )rU   r   sider   s      r?   r   %DatetimeIndex._maybe_cast_slice_boundz  sg     eRWW%%j.L.L e$224E/<

--e4rX   c                v   [        U[        R                  5      (       aD  [        U[        R                  5      (       a%  Ub  US:w  a  [        S5      eU R	                  X5      $ [        U[        R                  5      (       d  [        U[        R                  5      (       a  [        S5      eSS jnU" U5      (       d  U" U5      (       d  U R                  (       a  [        R                  " XX#5      $ [        R                  " S5      nSnUb+  U R                  US5      nXp:*  nXgU :H  R                  5       -  nUb.  U R                  US5      nX:*  U-  nXhU :H  R                  5       -  nU(       d  [        S	5      eUR                  5       S
   SSU2   n	[        U	5      [        U 5      :X  a  [        S5      $ U	$ )a  
Return indexer for specified label slice.
Index.slice_indexer, customized to handle time slicing.

In addition to functionality provided by Index.slice_indexer, does the
following:

- if both `start` and `end` are instances of `datetime.time`, it
  invokes `indexer_between_time`
- if `start` and `end` are both either string or None perform
  value-based selection in non-monotonic cases.

Nr   z)Must have step size of 1 with time slicesz'Cannot mix time and non-time slice keysc                B    U S L=(       a    [        U [        5      (       + $ rQ   )r1   r   )points    r?   check_str_or_none6DatetimeIndex.slice_indexer.<locals>.check_str_or_none  s    $CZs-C)CCrX   TleftrightzcValue based partial slicing on non-monotonic DatetimeIndexes with non-existing keys is not allowed.r   returnbool)r1   r   rJ   r   indexer_between_timer   is_monotonic_increasingr   slice_indexernparrayr   anynonzerolenslice)
rU   r   r   stepr   maskin_indexstart_casted
end_castedindexers
             r?   r  DatetimeIndex.slice_indexer  s   " eRWW%%*S"''*B*BDAI !LMM,,U88eRWW%%C)A)ADEE	D e$$ %%++&&tC>>xx~77vFL'D-2244H?55c7CJ&$.Dt+0022H9  ,,.#FdF+w<3t9$;NrX   c                    g)N
datetime64r   rT   s    r?   inferred_typeDatetimeIndex.inferred_type  s     rX   c                   U(       a  [        S5      e[        U[        5      (       a  SSKJn  U" U5      R                  5       nUR                  (       aB  U R                  c  [        S5      eU R                  UR                  5      R                  5       nOU R                  5       n[        U5      nXE:H  R                  5       S   $ )a  
Return index locations of values at particular time of day.

Parameters
----------
time : datetime.time or str
    Time passed in either as object (datetime.time) or as string in
    appropriate format ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p",
    "%H:%M:%S", "%H%M%S", "%I:%M:%S%p", "%I%M%S%p").

Returns
-------
np.ndarray[np.intp]

See Also
--------
indexer_between_time : Get index locations of values between particular
    times of day.
DataFrame.at_time : Select values at particular time of day.

Examples
--------
>>> idx = pd.DatetimeIndex(["1/1/2020 10:00", "2/1/2020 11:00",
...                         "3/1/2020 10:00"])
>>> idx.indexer_at_time("10:00")
array([0, 2])
z 'asof' argument is not supportedr   )parsezIndex must be timezone aware.)r   r1   r   dateutil.parserr  rJ   rG   r-   r   rB   r   _time_to_microsr	  )rU   rJ   asofr  time_microsr   s         r?   r   DatetimeIndex.indexer_at_time  s    8 %&HIIdC  -;##%D;;ww !@AA//$++6GGIK//1K &%..033rX   c                   [        U5      n[        U5      nU R                  5       n[        U5      n[        U5      nU(       a  U(       a  [        R                  =pOaU(       a!  [        R                  n[        R
                  n	O9U(       a!  [        R
                  n[        R                  n	O[        R
                  =pX::  a  [        R                  n
O[        R                  n
U
" U" Xe5      U	" XW5      5      nUR                  5       S   $ )a  
Return index locations of values between particular times of day.

Parameters
----------
start_time, end_time : datetime.time, str
    Time passed either as object (datetime.time) or as string in
    appropriate format ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p",
    "%H:%M:%S", "%H%M%S", "%I:%M:%S%p","%I%M%S%p").
include_start : bool, default True
include_end : bool, default True

Returns
-------
np.ndarray[np.intp]

See Also
--------
indexer_at_time : Get index locations of values at particular time of day.
DataFrame.between_time : Select values between particular times of day.

Examples
--------
>>> idx = pd.date_range("2023-01-01", periods=4, freq="h")
>>> idx
DatetimeIndex(['2023-01-01 00:00:00', '2023-01-01 01:00:00',
                   '2023-01-01 02:00:00', '2023-01-01 03:00:00'],
                  dtype='datetime64[ns]', freq='h')
>>> idx.indexer_between_time("00:00", "2:00", include_end=False)
array([0, 1])
r   )	r   r   r  operatorleltand_or_r	  )rU   r   r   include_startinclude_endr  start_micros
end_microslopropjoin_opr  s               r?   r  "DatetimeIndex.indexer_between_time  s    D Z(
8$++-&z2$X.
[ #C#++C++C++C++C #C!mmGllGs<5s;7ST||~a  rX   r   )r  ztype[libindex.DatetimeEngine])r  r   )r  r$   )rg   rg   )rk   r%   rl   r&   r  r$   rQ   )r  r)   )r  r(   )r  r
   )r.   zFrequency | lib.NoDefaultr   zbool | lib.NoDefaultrk   r%   r   r  r   r  r/   zDtype | Noner   r  r\   Hashable | Noner  r$   r   )r/   r!   r  r  )r  znpt.NDArray[np.int64])S)r.   r"   r  r2   )r   r
   r   zdt.datetime)r   r   )r  None)r   r   )NNN)r  r   )F)r  r  r  npt.NDArray[np.intp])TT)r$  r  r%  r  r  r/  )+r   
__module____qualname____firstlineno____doc___typr   	_data_cls!_supports_partial_string_indexingpropertyrV   __annotations__r   rC   rB   rA   rp   rs   rv   r   r{   r	   r   r9   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r  __static_attributes____classcell__)r   s   @r?   r2   r2   j   s   4~@ DI(,%' ' 
 			 8 !8 		!	!"R #R 		"	"# $+'.	; !; %	;
 
; $; 		 	 !< "< 		%	%&6 '6 		"	"#" $" * * *-..>>*-..~~#*" $A (A
 (A !A A A A A A 
AJ + + 9+ - -/&6#>P#J	)2.h 			7	78	  9	 ;~  
+4\ UY:!37:!MQ:!	:! :!rX   r2   )r   c                   Uc  [         R                  " X U5      (       a  Sn[        R                  " SU UUUUUUUS.U	D6n
[        R                  XS9$ )a1  
Return a fixed frequency DatetimeIndex.

Returns the range of equally spaced time points (where the difference between any
two adjacent points is specified by the given frequency) such that they all
satisfy `start <[=] x <[=] end`, where the first one and the last one are, resp.,
the first and last time points in that range that fall on the boundary of ``freq``
(if given as a frequency string) or that are valid for ``freq`` (if given as a
:class:`pandas.tseries.offsets.DateOffset`). (If exactly one of ``start``,
``end``, or ``freq`` is *not* specified, this missing parameter can be computed
given ``periods``, the number of timesteps in the range. See the note below.)

Parameters
----------
start : str or datetime-like, optional
    Left bound for generating dates.
end : str or datetime-like, optional
    Right bound for generating dates.
periods : int, optional
    Number of periods to generate.
freq : str, Timedelta, datetime.timedelta, or DateOffset, default 'D'
    Frequency strings can have multiples, e.g. '5h'. See
    :ref:`here <timeseries.offset_aliases>` for a list of
    frequency aliases.
tz : str or tzinfo, optional
    Time zone name for returning localized DatetimeIndex, for example
    'Asia/Hong_Kong'. By default, the resulting DatetimeIndex is
    timezone-naive unless timezone-aware datetime-likes are passed.
normalize : bool, default False
    Normalize start/end dates to midnight before generating date range.
name : str, default None
    Name of the resulting DatetimeIndex.
inclusive : {"both", "neither", "left", "right"}, default "both"
    Include boundaries; Whether to set each bound as closed or open.

    .. versionadded:: 1.4.0
unit : str, default None
    Specify the desired resolution of the result.

    .. versionadded:: 2.0.0
**kwargs
    For compatibility. Has no effect on the result.

Returns
-------
DatetimeIndex

See Also
--------
DatetimeIndex : An immutable container for datetimes.
timedelta_range : Return a fixed frequency TimedeltaIndex.
period_range : Return a fixed frequency PeriodIndex.
interval_range : Return a fixed frequency IntervalIndex.

Notes
-----
Of the four parameters ``start``, ``end``, ``periods``, and ``freq``,
exactly three 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 `this link
<https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.

Examples
--------
**Specifying the values**

The next four examples generate the same `DatetimeIndex`, but vary
the combination of `start`, `end` and `periods`.

Specify `start` and `end`, with the default daily frequency.

>>> pd.date_range(start='1/1/2018', end='1/08/2018')
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
              dtype='datetime64[ns]', freq='D')

Specify timezone-aware `start` and `end`, with the default daily frequency.

>>> pd.date_range(
...     start=pd.to_datetime("1/1/2018").tz_localize("Europe/Berlin"),
...     end=pd.to_datetime("1/08/2018").tz_localize("Europe/Berlin"),
... )
DatetimeIndex(['2018-01-01 00:00:00+01:00', '2018-01-02 00:00:00+01:00',
               '2018-01-03 00:00:00+01:00', '2018-01-04 00:00:00+01:00',
               '2018-01-05 00:00:00+01:00', '2018-01-06 00:00:00+01:00',
               '2018-01-07 00:00:00+01:00', '2018-01-08 00:00:00+01:00'],
              dtype='datetime64[ns, Europe/Berlin]', freq='D')

Specify `start` and `periods`, the number of periods (days).

>>> pd.date_range(start='1/1/2018', periods=8)
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
              dtype='datetime64[ns]', freq='D')

Specify `end` and `periods`, the number of periods (days).

>>> pd.date_range(end='1/1/2018', periods=8)
DatetimeIndex(['2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28',
               '2017-12-29', '2017-12-30', '2017-12-31', '2018-01-01'],
              dtype='datetime64[ns]', freq='D')

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

>>> pd.date_range(start='2018-04-24', end='2018-04-27', periods=3)
DatetimeIndex(['2018-04-24 00:00:00', '2018-04-25 12:00:00',
               '2018-04-27 00:00:00'],
              dtype='datetime64[ns]', freq=None)

**Other Parameters**

Changed the `freq` (frequency) to ``'ME'`` (month end frequency).

>>> pd.date_range(start='1/1/2018', periods=5, freq='ME')
DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31', '2018-04-30',
               '2018-05-31'],
              dtype='datetime64[ns]', freq='ME')

Multiples are allowed

>>> pd.date_range(start='1/1/2018', periods=5, freq='3ME')
DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
               '2019-01-31'],
              dtype='datetime64[ns]', freq='3ME')

`freq` can also be specified as an Offset object.

>>> pd.date_range(start='1/1/2018', periods=5, freq=pd.offsets.MonthEnd(3))
DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
               '2019-01-31'],
              dtype='datetime64[ns]', freq='3ME')

Specify `tz` to set the timezone.

>>> pd.date_range(start='1/1/2018', periods=5, tz='Asia/Tokyo')
DatetimeIndex(['2018-01-01 00:00:00+09:00', '2018-01-02 00:00:00+09:00',
               '2018-01-03 00:00:00+09:00', '2018-01-04 00:00:00+09:00',
               '2018-01-05 00:00:00+09:00'],
              dtype='datetime64[ns, Asia/Tokyo]', freq='D')

`inclusive` controls whether to include `start` and `end` that are on the
boundary. The default, "both", includes boundary points on either end.

>>> pd.date_range(start='2017-01-01', end='2017-01-04', inclusive="both")
DatetimeIndex(['2017-01-01', '2017-01-02', '2017-01-03', '2017-01-04'],
              dtype='datetime64[ns]', freq='D')

Use ``inclusive='left'`` to exclude `end` if it falls on the boundary.

>>> pd.date_range(start='2017-01-01', end='2017-01-04', inclusive='left')
DatetimeIndex(['2017-01-01', '2017-01-02', '2017-01-03'],
              dtype='datetime64[ns]', freq='D')

Use ``inclusive='right'`` to exclude `start` if it falls on the boundary, and
similarly ``inclusive='neither'`` will exclude both `start` and `end`.

>>> pd.date_range(start='2017-01-01', end='2017-01-04', inclusive='right')
DatetimeIndex(['2017-01-02', '2017-01-03', '2017-01-04'],
              dtype='datetime64[ns]', freq='D')

**Specify a unit**

>>> pd.date_range(start="2017-01-01", periods=10, freq="100YS", unit="s")
DatetimeIndex(['2017-01-01', '2117-01-01', '2217-01-01', '2317-01-01',
               '2417-01-01', '2517-01-01', '2617-01-01', '2717-01-01',
               '2817-01-01', '2917-01-01'],
              dtype='datetime64[s]', freq='100YS-JAN')
D)r   r   periodsr.   r-   r   	inclusiver   rj   r   )comany_noner   _generate_ranger2   r4   )r   r   r=  r.   r-   r   r\   r>  r   kwargsr   s              r?   
date_rangerC  5  sl    p |WS99)) 

 
E $$U$66rX   c
                b   Uc  Sn[        U5      e[        U[        5      (       a0  UR                  S5      (       a   U=(       d    Sn[        U   " XS9nOU(       d  U(       a  SU 3n[        U5      e[        S	U UUUUUUU	S.U
D6$ ! [
        [         4 a  nSU 3n[        U5      UeSnAff = f)
aL  
Return a fixed frequency DatetimeIndex with business day as the default.

Parameters
----------
start : str or datetime-like, default None
    Left bound for generating dates.
end : str or datetime-like, default None
    Right bound for generating dates.
periods : int, default None
    Number of periods to generate.
freq : str, Timedelta, datetime.timedelta, or DateOffset, default 'B'
    Frequency strings can have multiples, e.g. '5h'. The default is
    business daily ('B').
tz : str or None
    Time zone name for returning localized DatetimeIndex, for example
    Asia/Beijing.
normalize : bool, default False
    Normalize start/end dates to midnight before generating date range.
name : str, default None
    Name of the resulting DatetimeIndex.
weekmask : str or None, default None
    Weekmask of valid business days, passed to ``numpy.busdaycalendar``,
    only used when custom frequency strings are passed.  The default
    value None is equivalent to 'Mon Tue Wed Thu Fri'.
holidays : list-like or None, default None
    Dates to exclude from the set of valid business days, passed to
    ``numpy.busdaycalendar``, only used when custom frequency strings
    are passed.
inclusive : {"both", "neither", "left", "right"}, default "both"
    Include boundaries; Whether to set each bound as closed or open.

    .. versionadded:: 1.4.0
**kwargs
    For compatibility. Has no effect on the result.

Returns
-------
DatetimeIndex

Notes
-----
Of the four parameters: ``start``, ``end``, ``periods``, and ``freq``,
exactly three must be specified.  Specifying ``freq`` is a requirement
for ``bdate_range``.  Use ``date_range`` if specifying ``freq`` is not
desired.

To learn more about the frequency strings, please see `this link
<https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.

Examples
--------
Note how the two weekend days are skipped in the result.

>>> pd.bdate_range(start='1/1/2018', end='1/08/2018')
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
           '2018-01-05', '2018-01-08'],
          dtype='datetime64[ns]', freq='B')
Nz>freq must be specified for bdate_range; use date_range insteadCzMon Tue Wed Thu Fri)holidaysweekmaskz!invalid custom frequency string: zZa custom frequency string is required when holidays or weekmask are passed, got frequency )r   r   r=  r.   r-   r   r\   r>  r   )r   r1   r   
startswithr   r   r   rC  )r   r   r=  r.   r-   r   r\   rG  rF  r>  rB  msgr   s                r?   bdate_rangerJ    s    P |Nn$!5!5	+8#8H!$'MD 
X2269 	 o 

 
 
 )$ 	+5dV<CS/s*	+s   B B.B))B.c                    U R                   S-  S-  SU R                  -  -   U R                  -   nSU-  U R                  -   $ )N<   r   )hourminutesecondmicrosecond)time_objsecondss     r?   r  r  e  sB    mmb 2%X__(<<xNGw!5!555rX   )NNNNNFNboth)
r   r  r\   r,  r>  r#   r   z
str | Noner  r2   )
NNNBNTNNNrS  )r=  z
int | Noner.   zFrequency | dt.timedeltar   r  r\   r,  r>  r#   r  r2   )rQ  zdt.timer  int)P
__future__r   r   r   r  typingr   r6   numpyr  r   pandas._libsr   r   r   r   rR   r	   pandas._libs.tslibsr
   r   r   r   r   r   pandas._libs.tslibs.offsetsr   pandas.util._decoratorsr   r   pandas.util._exceptionsr   pandas.core.dtypes.commonr   pandas.core.dtypes.dtypesr   pandas.core.dtypes.genericr   pandas.core.dtypes.missingr   pandas.core.arrays.datetimesr   r   pandas.core.commoncorecommonr?  pandas.core.indexes.baser   r    pandas.core.indexes.datetimeliker   pandas.core.indexes.extensionr   pandas.core.tools.timesr   collections.abcr   pandas._typingr    r!   r"   r#   r$   r%   r&   r'   pandas.core.apir(   r)   pandas._libs.tslibs.dtypesr*   r@   
_field_ops_datetimelike_methods	_bool_opsr2   rC  rJ  r  )methods   0r?   <module>rr     s   "          7 5 / 5 0 < !   D 7 +(	 	 	
 @B  $999FBB 	9 		  -t<	 
 o
!* o
! =	2o
!f 	 $*F7 F7 F7 F7 "F7 F7 F7T %( $*d d #	d d d "d dN6ss   #
E3
1E3
