1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
U
¬ý°dxã @sddlmZddlZddlZddlmZmZddlZddl    Z
ddl Z ddl m Z mZmZmZmZddlmZmZmZmZddlmZddlmZmZmZmZmZm Z m!Z!ddl"m#Z#m$Z$dd    l%m&Z&m'Z'm(Z(dd
l)m*Z*dd l+m,Z,dd l-m.Z.m/Z/ddl0m1m2Z3dd l4m5Z5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<erPddl=m>Z>m?Z?dd„Z@e:e.jAdd„e.jBDƒe.dde:dge.dde:ddddddd d!d"g    e.jCe.ƒGd#d$„d$e8ƒƒƒƒZDd:dd'œd(d)d*d+d$d,œd-d.„ZEd;d0d1d(d)d*d$d2œd3d4„ZFd5d6d7œd8d9„ZGdS)<é)Ú annotationsN)Ú TYPE_CHECKINGÚHashable)ÚNaTÚPeriodÚ    TimestampÚindexÚlib)Ú
ResolutionÚperiods_per_dayÚ    timezonesÚ    to_offset)Úprefix_mapping)ÚDtypeÚDtypeObjÚ    FrequencyÚIntervalClosedTypeÚ TimeAmbiguousÚTimeNonexistentÚnpt)Úcache_readonlyÚdoc)Úis_datetime64_dtypeÚis_datetime64tz_dtypeÚ    is_scalar)Ú    ABCSeries)Úis_valid_na_for_dtype)Ú DatetimeArrayÚ tz_to_dtype)ÚIndexÚmaybe_extract_name)ÚDatetimeTimedeltaMixin)Ú inherit_names)Úto_time)Ú    DataFrameÚ PeriodIndexc    CsÊd|kršt|dtƒsš| d¡}t|tƒsT| d¡}| d¡}tj|t|ƒ|d}n6|}dD],}||kr\||t||ƒks~t‚| |¡q\|j|f|Ž}n,t     ¡t 
d¡|j |f|Ž}W5QRX|S)zu
    This is called upon unpickling, rather than the default which doesn't
    have arguments and breaks __new__
    ÚdataÚtzÚfreq)Údtyper()r'r(Úignore) Ú
isinstanceÚ DatetimeIndexÚpoprÚ _simple_newrÚgetattrÚAssertionErrorÚwarningsÚcatch_warningsÚ simplefilterÚ__new__)ÚclsÚdr&r'r(ÚdtaÚkeyÚresult©r:úTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/indexes/datetimes.pyÚ_new_DatetimeIndexFs 
 
 
 
 
 
r<cCsg|]}|dkr|‘qS))Ú tz_localizeÚ
tz_convertÚstrftimer:)Ú.0Úmethodr:r:r;Ú
<listcomp>isþrBT)ÚwrapÚ is_normalized)Úcacher'Útzinfor)Ú to_pydatetimeZ_format_native_typesÚdateÚtimeÚtimetzZstdc s&eZdZUdZdZeZdZeddœdd„ƒZ    de
d    <d
e
d <e ej ƒd dœd d„ƒZ e ej ƒddœdd„ƒZ e ejƒdZddddœdd„ƒZe ejƒd[ddœdd„ƒZe ejƒd dœdd„ƒZe ejƒddœdd„ƒZed dœd!d"„ƒZdejejd#ddd#d#dd#df d$d%dd%d%d&d%d'dd(œ    d)d*„Zed%dœd+d,„ƒZd-d.„Zd/d%d0œd1d2„Zed3d4„ƒZd%dœ‡fd5d6„ Zd7dœd8d9„Zd\d;dd<œd=d>„Zd d?d@œdAdB„ZdCdDœ‡fdEdF„ ZdGdœdHdI„Z dJdK„Z!e e"j#ƒdCdLœ‡fdMdN„ ƒZ#d]dOdP„Z$edCdœdQdR„ƒZ%d^d%dSdTœdUdV„Z&d_d%d%dSdWœdXdY„Z'‡Z(S)`r,u!
    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.
    closed : {'left', 'right'}, optional
        Set whether to include `start` and `end` that are on the
        boundary. The default includes boundary points on either end.
    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
    weekofyear
    week
    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>`__.
    Z datetimeindexTztype[libindex.DatetimeEngine]©ÚreturncCstjS©N)ÚlibindexZDatetimeEngine©Úselfr:r:r;Ú _engine_typeüszDatetimeIndex._engine_typerÚ_datazdt.tzinfo | Noner'rcCs|j |¡}t||jtdS)N)Únamer))rRr?rrSÚobject)rPZ date_formatÚarrr:r:r;r?s zDatetimeIndex.strftimecCs$|j |¡}t|ƒj||j|jdS)N©rSÚrefs)rRr>Útyper.rSÚ _references)rPr'rUr:r:r;r> s zDatetimeIndex.tz_convertÚraiserr)Ú    ambiguousÚ nonexistentrLcCs$|j |||¡}t|ƒj||jdS©N©rS)rRr=rXr.rS)rPr'r[r\rUr:r:r;r=szDatetimeIndex.tz_localizeNr%cCs(ddlm}|j |¡}|j||jdS)Nr)r%r^)Zpandas.core.indexes.apir%rRÚ    to_periodr.rS)rPr(r%rUr:r:r;r_s  zDatetimeIndex.to_periodcCs|j ¡}tj||jdSr])rRÚto_julian_daterr.rS)rPrUr:r:r;r`!s
zDatetimeIndex.to_julian_dater$cCs|j ¡}| |¡SrM)rRÚ isocalendarZ    set_index)rPZdfr:r:r;ra&s
zDatetimeIndex.isocalendarr
cCs|jjSrM)rRÚ_resolution_objrOr:r:r;rb+szDatetimeIndex._resolution_objFzFrequency | lib.NoDefaultÚboolz Dtype | Noner)    r(Ú    normalizer[ÚdayfirstÚ    yearfirstr)ÚcopyrSrLc 
Cs¨t|ƒr| |¡t| ||ƒ} t|tƒr^|tjkr^|tjkr^|    dkr^|
rP| ¡}|j|| dStj    ||    |
|||||d} d} |
s”t|t
t fƒr”|j } |j| | | d}|S)Nr^)r)rgr'r(rerfr[rV) rZ_raise_scalar_data_errorr r+rr    Ú
no_defaultrgr.Z_from_sequence_not_strictrrrY)r5r&r(r'rdÚclosedr[rerfr)rgrSÚdtarrrWZsubarrr:r:r;r42s:
 ÿþýüø
zDatetimeIndex.__new__cCs ddlm}|jdko||jƒS)z
        Return a boolean if we are only dates (and don't have a timezone)
 
        Returns
        -------
        bool
        r)Ú is_dates_onlyN)Úpandas.io.formats.formatrkr'Z_values)rPrkr:r:r;Ú_is_dates_onlyfs     zDatetimeIndex._is_dates_onlycCs |j|jdœ}tt|ƒ|fdfS)N)r&rS)rRrSr<rX)rPr6r:r:r;Ú
__reduce__vszDatetimeIndex.__reduce__r)r)rLcCs|jdk    rt|ƒSt|ƒS)zF
        Can we compare values of the given dtype to our own?
        N)r'rr)rPr)r:r:r;Ú_is_comparable_dtypezs
z"DatetimeIndex._is_comparable_dtypecs$ddlm}||jd‰‡fdd„S)Nr)Úget_format_datetime64)Zis_dates_only_csdˆ|ƒ›dS)Nú'r:)Úx©Ú    formatterr:r;Ú<lambda>Œóz/DatetimeIndex._formatter_func.<locals>.<lambda>)rlrprm)rPrpr:rsr;Ú_formatter_func‡s  zDatetimeIndex._formatter_funccsX|jdk    r&t |j¡s&t |j¡s&dS|jdk    rLt |j¡sLt |j¡sLdStƒ |¡S)NF)r'r Zis_utcZis_fixed_offsetÚsuperÚ_can_range_setop)rPÚother©Ú    __class__r:r;ry‘sÿ
þ
ýÿ
þ
ýzDatetimeIndex._can_range_setopznpt.NDArray[np.int64]cCs‚|j ¡}t|jjƒ}||}|jdkr2|d}nB|jdkrB|}n2|jdkrV|d}n|jdkrj|d}n
t|jƒ‚d||j<|S)z}
        Return the number of microseconds since midnight.
 
        Returns
        -------
        ndarray[int64_t]
        ÚnsièÚusÚmsÚsé@Béÿÿÿÿ)rRZ_local_timestampsr Z_cresoÚunitÚNotImplementedErrorZ_isnan)rPÚvaluesZppdÚfracÚmicrosr:r:r;Ú_get_time_micros¤s
 
 
 
 
 
 
 
 
 
zDatetimeIndex._get_time_microsÚSr)r(rLcCs€t|ƒ}|j ¡}t|ƒD]T\}}|}| |¡sf| |¡}| |¡}t||ƒt||ƒkrb|}n|}|||<qtj    ||j
dS)zy
        Snap time stamps to nearest occurring frequency.
 
        Returns
        -------
        DatetimeIndex
        r^) r rRrgÚ    enumerateZ is_on_offsetÚrollbackZ rollforwardÚabsr,r.rS)rPr(r7ÚiÚvr€Út0Út1r:r:r;Úsnap¿s    
 
 
 
 
zDatetimeIndex.snapz dt.datetime)ÚresoÚparsedcCsXt||jd}|j|j}}| |j¡}| |j¡}|jdk    rP|jdkrPtdƒ‚||fS)aP
        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(NzSThe index must be timezone aware when indexing with a date string with a UTC offset)rZ attr_abbrevÚ
start_timeÚend_timer=rFr'Ú
ValueError)rPr’r“ZperÚstartÚendr:r:r;Ú_parsed_string_to_boundsÜs  
 
ÿz&DatetimeIndex._parsed_string_to_boundsÚstr)Úlabelcs@tƒ |¡\}}t|ƒ}|jdk    r8|jdkr8| |j¡}||fSrM)rxÚ_parse_with_resorr'rFr=)rPr›r“r’r{r:r;rœs
 zDatetimeIndex._parse_with_resoÚNonec
CsBz|j |¡Wn,tk
r<}zt|ƒ|‚W5d}~XYnXdS)zU
        Check for mismatched-tzawareness indexing and re-raise as KeyError.
        N)rRÚ_assert_tzawareness_compatÚ    TypeErrorÚKeyError)rPr8Úerrr:r:r;Ú_disallow_mismatched_indexing sz+DatetimeIndex._disallow_mismatched_indexingc
Csx| |¡|}t||jƒrt}t||jjƒr@| |¡t|ƒ}nöt|t    ƒræz| 
|¡\}}Wn2t t j fk
rŽ}zt|ƒ|‚W5d}~XYnX| |¡| |¡ràz| ||¡WStk
rÞ}zt|ƒ|‚W5d}~XYnX|}nPt|tjƒrtdt|ƒj›dt|ƒj›ƒ‚n t|tjƒr.| |¡St|ƒ‚zt ||¡WStk
rr}zt|ƒ|‚W5d}~XYnXdS)zm
        Get integer location for requested label
 
        Returns
        -------
        loc : int
        Nz Cannot index z with )Z_check_indexing_errorrr)rr+rRZ_recognized_scalarsr¢rršrœr–ÚpytzZNonExistentTimeErrorr Z_can_partial_date_sliceZ_partial_date_sliceÚdtÚ    timedeltarŸrXÚ__name__rIÚindexer_at_timerÚget_loc)rPr8Zorig_keyr“r’r¡r:r:r;r¨s<
 
 
 
 
 
ÿ
zDatetimeIndex.get_loc)ÚsidecsFt|tjƒr$t|tjƒs$t|ƒ ¡}tƒ ||¡}|j     |¡t|ƒSrM)
r+r¤rHÚdatetimerrGrxÚ_maybe_cast_slice_boundrRrž)rPr›r©r{r:r;r«Ls
  z%DatetimeIndex._maybe_cast_slice_boundc
Cs>t|tjƒr<t|tjƒr<|dk    r0|dkr0tdƒ‚| ||¡St|tjƒsTt|tjƒr\tdƒ‚ddœdd„}||ƒs€||ƒs€|jrt ||||¡St     
d    ¡}t     
d    ¡}|dk    rÈ|  |d
¡}||k}||k}|dk    rô|  |d ¡}||k|@}||k|B}|  ¡std ƒ‚|  ¡d dd|…}    t|    ƒt|ƒkr6tdƒS|    SdS)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.
 
        Néz)Must have step size of 1 with time slicesz'Cannot mix time and non-time slice keysrcrKcSs|dk    ot|tƒ SrM)r+rš)Zpointr:r:r;Úcheck_str_or_noneqsz6DatetimeIndex.slice_indexer.<locals>.check_str_or_noneTÚleftÚrightzcValue based partial slicing on non-monotonic DatetimeIndexes with non-existing keys is not allowed.r)r+r¤rIr–Úindexer_between_timer Zis_monotonic_increasingrÚ slice_indexerÚnpÚarrayr«ÚanyÚnonzeroÚlenÚslice)
rPr—r˜Ústepr­ÚmaskZ
raise_maskZ start_castedZ
end_castedZindexerr:r:r;r±Xs@ ÿþý
 
 
ÿzDatetimeIndex.slice_indexercCsdS)NZ
datetime64r:rOr:r:r;Ú inferred_type—szDatetimeIndex.inferred_typeznpt.NDArray[np.intp])ÚasofrLcCsx|r tdƒ‚t|tƒr.ddlm}||ƒ ¡}|jrX|jdkrFtdƒ‚|     |j¡ 
¡}n| 
¡}t |ƒ}||k  ¡dS)av
        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.
        z 'asof' argument is not supportedr)ÚparseNzIndex must be timezone aware.) r„r+ršZdateutil.parserr¼rIrFr'r–r>rˆÚ_time_to_microsrµ)rPrIr»r¼Ú time_microsr‡r:r:r;r§s
 
zDatetimeIndex.indexer_at_time)Ú include_startÚ include_endrLc Cs¢t|ƒ}t|ƒ}| ¡}t|ƒ}t|ƒ}|r<|r<tj}}    n.|rNtj}tj}    n|r`tj}tj}    n
tj}}    ||krztj}
ntj}
|
|||ƒ|    ||ƒƒ} |  ¡dS)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.
        r)    r#rˆr½ÚoperatorÚleÚltÚand_Úor_rµ) rPr”r•r¿rÀr¾Z start_microsZ
end_microsZlopZropZjoin_opr¹r:r:r;r°Ãs& 
z"DatetimeIndex.indexer_between_time)rZrZ)N)r‰)NNN)F)TT))r¦Ú
__module__Ú __qualname__Ú__doc__Z_typrZ    _data_clsZ!_supports_partial_string_indexingÚpropertyrQÚ__annotations__rr?r>r=r_r`rarrbr    rhr4rmrnrorwryrˆr‘r™rœr¢r¨r!r«r±rºr§r°Ú __classcell__r:r:r{r;r,gst
uü    ô 4 
    $  4
?'ÿr,FÚboth)rƒrcrrz
str | None)rdrSÚ    inclusiverƒrLc KsJ|dkrt |||¡rd}tjf||||||||dœ|    —Ž}
tj|
|dS)a4
    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, 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 ``'M'`` (month end frequency).
 
    >>> pd.date_range(start='1/1/2018', periods=5, freq='M')
    DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31', '2018-04-30',
                   '2018-05-31'],
                  dtype='datetime64[ns]', freq='M')
 
    Multiples are allowed
 
    >>> pd.date_range(start='1/1/2018', periods=5, freq='3M')
    DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
                   '2019-01-31'],
                  dtype='datetime64[ns]', freq='3M')
 
    `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='3M')
 
    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="100AS", 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='100AS-JAN')
    NÚD)r—r˜Úperiodsr(r'rdrÍrƒr^)ÚcomZany_nonerZ_generate_ranger,r.) r—r˜rÏr(r'rdrSrÍrƒÚkwargsrjr:r:r;Ú
date_rangeös 9ø    ÷ rÒÚBz
int | Noner)rÏr(rdrSrÍrLc
Ks¼|dkrd} t| ƒ‚t|tƒr‚| d¡r‚z|p0d}t|||d}Wqœttfk
r~} zd|›} t| ƒ| ‚W5d} ~ XYqœXn|sŠ|rœd|›} t| ƒ‚tf||||||||    dœ|
—ŽS)    a    
    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ÚCzMon 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'rdrSrÍ)rŸr+ršÚ
startswithrr r–rÒ) r—r˜rÏr(r'rdrSrÖrÕrÍrÑÚmsgr¡r:r:r;Ú bdate_range¿s4H
ÿø    ÷rÙzdt.timeÚint)Útime_objrLcCs,|jddd|j|j}d||jS)Né<r)ÚhourÚminuteÚsecondÚ microsecond)rÛÚsecondsr:r:r;r½&sr½)NNNNNFNrÌ)
NNNrÓNTNNNrÌ)HÚ
__future__rrªr¤rÁÚtypingrrr1Únumpyr²r£Z pandas._libsrrrrrNr    Zpandas._libs.tslibsr
r r r Zpandas._libs.tslibs.offsetsrZpandas._typingrrrrrrrZpandas.util._decoratorsrrZpandas.core.dtypes.commonrrrZpandas.core.dtypes.genericrZpandas.core.dtypes.missingrZpandas.core.arrays.datetimesrrZpandas.core.commonÚcoreÚcommonrÐZpandas.core.indexes.baserr Z pandas.core.indexes.datetimeliker!Zpandas.core.indexes.extensionr"Zpandas.core.tools.timesr#Zpandas.core.apir$r%r<Z
_field_opsZ_datetimelike_methodsZ    _bool_opsr,rÒrÙr½r:r:r:r;Ú<module>sš  $         !þÿø
÷ õ ózø
öKög