+
    Ŝiܣ              
        a  0 t $ ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHtHtHtHt ^ RIt^ RIt^ RIHtHt ^ R	IHtHtHtHtHtHtHtH t! ^ R
I"H#t# ^ RI$H%t%H&t& ^ RI'H(t( ^ RI)H*t*H+t+H,t, ^ RI-H.t. ^ RI/H0t0 ^ RI1H2t2H3t3H4t4H5t5H6t6H7t7H8t8 ^ RI9H:t:H;t; ^ RI<H=t=H>t> ^ RI?H@t@HAtAHBtB ^ RICHDtD ^ RIEHFtF ^ RIGHHtH ^ RIIHJtJHKtKHLtL ^ RIMHNtN ^ RIOHPtP ^ RIQHRtR ]'       d#   ^ RISHTtTHUtU ^ RIVHWtW ^ RIXHYtY ^ RI)HZtZ ^ RI[H\t\H]t] ]^]_,          ]*,          t`R ]aR!&   ]b]c,          tdR ]aR"&   ]d],          ]P                  ,          tfR ]aR#&   ]f]`,          tgR ]aR$&   ]^]d,          ]_]dR%3,          ,          ]*,          thR ]aR&&    ! R' R(]R)R*7      ti ! R+ R,]iR-R*7      tj]]jR.3,          tk^2tlReR/ R0 lltmRfR1 R2 lltnR3 R4 ltoRgR5 R6 lltpRhR7 R8 lltqRiR: R; lltrR< R= ltsR> R? lttR@ tu]RjRA RB ll4       tv]RjRC RD ll4       tv]RjRE RF ll4       tv].! RG4      R9R-R-R-R]P                  RRHR)3	RI RJ ll4       tv/ RKRKbRLRKbRMRMbRNRMbRORObRPRObRQRRbRSRRbRTRUbRVRUbRWRXbRYRXbRZRZbR[RZbR\RZbR]R]bR^R]bR_R]R`R`RaR`RbR`/CtxRc Rd lty. RkOtzR# )l    )annotations)abc)date)partial)islice)TYPE_CHECKING	TypeAlias	TypedDictUnioncastoverloadN)libtslib)NaTOutOfBoundsDatetime	Timedelta	Timestampastype_overflowsafeget_supported_dtypeis_supported_dtype	timezones)cast_from_unit_vectorized)DateParseErrorguess_datetime_format)array_strptime)AnyArrayLike	ArrayLikeDateTimeErrorChoices)
set_module)find_stack_level)ensure_objectis_floatis_float_dtype
is_integeris_integer_dtypeis_list_likeis_numeric_dtype)
ArrowDtypeDatetimeTZDtype)ABCDataFrame	ABCSeries)DatetimeArrayIntegerArrayNumpyExtensionArray)unique)ArrowExtensionArray)ExtensionArray)maybe_convert_dtypeobjects_to_datetime64tz_to_dtype)extract_array)Index)DatetimeIndex)CallableHashable)NaTType)UnitChoices)TimeUnit)	DataFrameSeriesr	   ArrayConvertibleScalarDatetimeScalar DatetimeScalarOrArrayConvertible.DatetimeDictArgc                  6    ] tR t^lt$ R]R&   R]R&   R]R&   RtR# )YearMonthDayDictrC   yearmonthday N__name__
__module____qualname____firstlineno____annotations____static_attributes__rI       d/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/pandas/core/tools/datetimes.pyrE   rE   l   s    
	rQ   rE   T)totalc                  r    ] tR t^rt$ R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R	&   R]R
&   RtR# )FulldatetimeDictrC   hourhoursminuteminutessecondsecondsmsusnsrI   NrJ   rI   rQ   rR   rU   rU   r   s8    
rQ   rU   Fr=   c                    V ^8  d   QhRRRR/# )   dayfirstbool | Nonereturn
str | NonerI   )formats   "rR   __annotate__rf      s      K J rQ   c                ,   \         P                  ! V 4      ;pR8w  dw   \        W,          ;p4      \        J d\   \	        W1R7      pVe   V# \         P                  ! W^,           R 4      R8w  d&   \
        P                  ! R\        \        4       R7       R# )   ra   NzCould not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.)
stacklevel)	r   first_non_nulltypestrr   warningswarnUserWarningr    )arrra   rl   first_non_nan_elementguessed_formats   &&   rR    _guess_datetime_format_for_arrayru      s    ..s33:)<<%=D2%N )%% ##C(:(<$=>"DK  /1 rQ   c               (    V ^8  d   QhRRRRRRRR/# )	r`   argr?   unique_sharefloatcheck_countz
int | Nonerc   boolrI   )re   s   "rR   rf   rf      s,     9 9	9).9CM9	9rQ   c                   RpVf=   \        V 4      \        8:  d   R# \        V 4      R8:  d   \        V 4      ^
,          pM3RpM0^ Tu;8:  d   \        V 4      8:  g   Q R4       h Q R4       hV^ 8X  d   R# ^ Tu;8  d   ^8  g   Q R4       h Q R4       h \        \        W4      4      p\        T4      Y!,          8  d   RpT#   \         d     R# i ; i)a  
Decides whether to do caching.

If the percent of unique elements among `check_count` elements less
than `unique_share * 100` then we can do caching.

Parameters
----------
arg: listlike, tuple, 1-d array, Series
unique_share: float, default=0.7, optional
    0 < unique_share < 1
check_count: int, optional
    0 <= check_count <= len(arg)

Returns
-------
do_caching: bool

Notes
-----
By default for a sequence of less than 50 items in size, we don't do
caching; for the number of elements less than 5000, we take ten percent of
all elements to check for a uniqueness share; if the sequence size is more
than 5000, then we check only the first 500 elements.
All constants were chosen empirically by.
TFi  i  z1check_count must be in next bounds: [0; len(arg)]z+unique_share must be in next bounds: (0; 1))lenstart_caching_atsetr   	TypeError)rw   rx   rz   
do_cachingunique_elementss   &&&  rR   should_cacher      s    : J s8''s8tc(b.KKK+3s8+ 	
?	
+ 	
?	
+ !|aN!NNN!NNfS67 ?k88
	  s   C   CCc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r`   rw   r?   re   rd   cacher{   convert_listliker8   rc   r>   rI   )re   s   "rR   rf   rf      s:     / /	// / 	/
 /rQ   c                   ^ RI Hp V! \        R7      pV'       d   \        V 4      '       g   V# \	        V \
        P                  \        \        \        34      '       g   \
        P                  ! V 4      p \        V 4      p\        V4      \        V 4      8  dQ   V! Wa4      p V! WvRR7      pTP                  P                  '       g"   YUP                  P!                  4       ( ,          pV#   \         d    Tu # i ; i)a  
Create a cache of unique dates from an array of dates

Parameters
----------
arg : listlike, tuple, 1-d array, Series
format : string
    Strftime format to parse time
cache : bool
    True attempts to create a cache of converted values
convert_listlike : function
    Conversion function to apply on dates

Returns
-------
cache_array : Series
    Cache of converted, unique dates. Can be empty
r>   dtypeF)indexcopy)pandasr>   objectr   
isinstancenpndarrayr1   r6   r+   arrayr/   r}   r   r   	is_unique
duplicated)rw   re   r   r   r>   cache_arrayunique_datescache_datess   &&&&    rR   _maybe_cacher      s    0 v&KC  #

NE9MNN((3-Cc{|s3x'*<@K#$[5Q $$...)+<+<+G+G+I*IJ ' #""#s   "
C+ +C;:C;c               (    V ^8  d   QhRRRRRRRR/# )	r`   dt_arrayr   utcr{   nameHashable | Nonerc   r6   rI   )re   s   "rR   rf   rf   
  s,     < <<"<2A<
<rQ   c                    \         P                  ! V P                  R4      '       d   V'       d   RMRp\        WVR7      # \	        WV P                  R7      # )a  
Properly boxes the ndarray of datetimes to DatetimeIndex
if it is possible or to generic Index instead

Parameters
----------
dt_array: 1-d array
    Array of datetimes to be wrapped in an Index.
utc : bool
    Whether to convert/localize timestamps to UTC.
name : string, default None
    Name for a resulting index

Returns
-------
result : datetime of converted dates
    - DatetimeIndex if convertible to sole datetime64 type
    - general Index otherwise
Mr   Ntzr   )r   r   )r   is_np_dtyper   r7   r6   )r   r   r   r   s   &&& rR   _box_as_indexliker   
  s@    . x~~s++UtX488HNN;;rQ   c               (    V ^8  d   QhRRRRRRRR/# )	r`   rw   rB   r   r>   r   r   rc   r6   rI   )re   s   "rR   rf   rf   '  s6     C C	)CC C 	CrQ   c                    ^ RI Hp V! WP                  P                  R7      P	                  V4      p\        VP                  RVR7      # )aO  
Convert array of dates with a cache and wrap the result in an Index.

Parameters
----------
arg : integer, float, string, datetime, list, tuple, 1-d array, Series
cache_array : Series
    Cache of converted, unique dates
name : string, default None
    Name for a DatetimeIndex

Returns
-------
result : Index-like of converted dates
r   r   Fr   r   )r   r>   r   r   mapr   _values)rw   r   r   r>   results   &&&  rR   _convert_and_box_cacher   '  s;    ( C00667;;KHFV^^TBBrQ   raisec               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# )r`   re   rd   r   r   r   r{   uniterrorsr   ra   rb   	yearfirstexactrI   )re   s   "rR   rf   rf   A  sd     G9 G9G9 G9 
	G9
 G9 !G9 G9 G9 G9rQ   c	           	     4   \        V \        \        34      '       d   \        P                  ! V RR7      p M,\        V \
        4      '       d   \        P                  ! V 4      p \        V RR4      p	V'       d   RMRp
\        V	\        4      '       dT   \        V \        \        34      '       g   \        W
VR7      # V'       d!   V P                  R4      P                  R4      p V # \        V	\        4      '       d   V	P                  \        J d   V'       d   \        V \        4      '       de   \!        \"        V P                  4      pV	P$                  P&                  e   VP)                  R4      pMVP+                  R4      p\        VRR	7      p V # V	P$                  P&                  e   V P)                  R4      p V # V P+                  R4      p V # \,        P.                  ! V	R
4      '       d   \1        V	4      '       g:   \3        \        P4                  ! V 4      \        P6                  ! R4      VR8H  R7      p \        V \        \        34      '       g   \        W
VR7      # V'       d   V P                  R4      # V # Ve   Ve   \9        R4      h\;        WW#V4      # \        V R^4      ^8  d   \=        R4      h \?        V R\@        PB                  ! V
4      R7      w  r\K        T 4      p Tf   \M        YR7      pTe   TR8w  d   \O        YY1Y4      # \Q        T TTTTRR7      w  rTe   \        PR                  ! TP6                  4      ^ ,          p\!        RT4      p\U        TT4      pTPW                  RTPX                   R24      p\        PZ                  ! TTR7      p\        PZ                  ! TTR7      # \]        YTR7      #   \<         dM    TR8X  dD   \        PD                  ! \G        T 4      \        PH                  ! RR4      4      p\        YR7      u # h i ; i)a  
Helper function for to_datetime. Performs the conversions of 1D listlike
of dates

Parameters
----------
arg : list, tuple, ndarray, Series, Index
    date to be parsed
name : object
    None or string for the Index name
utc : bool
    Whether to convert/localize timestamps to UTC.
unit : str
    None or string of the frequency of the passed data
errors : str
    error handing behaviors from to_datetime, 'raise', 'coerce'
dayfirst : bool
    dayfirst parsing behavior from to_datetime
yearfirst : bool
    yearfirst parsing behavior from to_datetime
exact : bool, default True
    exact format matching behavior from to_datetime

Returns
-------
Index-like of parsed dates
Or   r   Nr   r   UTCFr   r   zM8[s]coerce)	is_coercez#cannot specify both format and unitndimzAarg must be a string, datetime, list, tuple, 1-d array, or Series)r   r   r   r^   r   ri   mixedT)ra   r   r   r   allow_objectr<   M8[]r   )/r   listtupler   r   r.   getattrr)   r,   r7   
tz_converttz_localizer(   rm   r   r6   r   r0   pyarrow_dtyper   _dt_tz_convert_dt_tz_localizer   r   r   r   asarrayr   
ValueError_to_datetime_with_unitr   r2   libtimezonesmaybe_get_tzfullr}   
datetime64r!   ru   _array_strptime_with_fallbackr3   datetime_datar4   viewr   _simple_newr   )rw   re   r   r   r   r   ra   r   r   	arg_dtyper   	arg_array_npvaluesr   	tz_parsedout_unitr   dt64_valuesdtas   &&&&&&&&&           rR   _convert_listlike_datetimesr   A  sr   L #e}%%hhs#&	C,	-	-hhsmWd+I4B)_--#}=>> $77..&2259C
	Iz	*	*y~~/J#u%% !4cii@	**--9 ) 8 8 ?I ) 9 9% @IIE2 
	 ((++7((/ 
 ))%0
	C	(	(!),,%

3! H,C #}=>> $77??5))
		BCC%cFCC	fa	 1	$O
 	
$Su9R9RSU9VW 
C~1#I f/,SUSS-F  ##FLL1!4
H-Ix0kkC

|1"56''5A((488V488E  Xwws3xud)CDH 55	s   7$O   APPc          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r`   r   r{   fmtrn   r   r   rc   r6   rI   )re   s   "rR   rf   rf     sE     D D 
D 
	D
 D D DrQ   c                   \        WWEVR7      w  rgVe}   \        P                  ! VP                  4      ^ ,          p\	        RV4      p\        WxR7      p	\        P                  ! WiR7      p
V'       d   V
P                  R4      p
\        WRR7      # VP                  \        8w  dQ   V'       dI   \        P                  ! VP                  4      ^ ,          p\	        RV4      p\        VRV R	2VRR
7      pV# \        WfP                  VRR
7      # )zD
Call array_strptime, with fallback behavior depending on 'errors'.
)r   r   r   r<   )r   r   r   r   F)r   r   r   z, UTC])r   r   r   )r   r   r   r   r   r)   r,   r   r   r6   r   )rw   r   r   r   r   r   r   tz_outr   r   r   ress   &&&&&&      rR   r   r     s     $CEcRNF-a0J%65''<..'CS%00		C-a0J%FCvV"44eL
||$UCCrQ   c               $    V ^8  d   QhRRRRRR/# )r`   r   r{   r   rn   rc   r6   rI   )re   s   "rR   rf   rf     s&     M M Ms Mu MrQ   c           
     >   \        V RR7      p \        V \        4      '       d   V P                  RV R24      pRpEM\        P
                  ! V 4      p V P                  P                  R9   d?   V P                  RV R2RR7      p\        VP                  4      p \        WWRR7      pRpEM7V P                  P                  R
8X  d   \        P                  ! RR7      ;_uu_ 4        V P                  \        P                  4      pRRR4       \        P                  ! V 4      p	WX8H  ,          P!                  4       '       d$   \        WW#VR7      p
\"        V
P$                  V	&   V
# \        P                  ! R	R7      ;_uu_ 4         \'        WR7      p RRR4       XP)                  R4      pRpM3V P                  \        RR7      p \*        P,                  ! V VVVR7      w  rV\/        WRR7      p
\        V
\.        4      '       g   V
# V
P1                  R4      P3                  V4      p
V'       d3   V
P4                  f   V
P1                  R4      p
V
# V
P3                  R4      p
V
#   \         d.    TR	8X  d   h T P                  \        4      p \        YY#T4      u # i ; i  + '       g   i     EL; i  \         dL   pTR	8w  d0   \        T P                  \        4      YY44      u Rp?uuRRR4       # \        RT R24      ThRp?ii ; i  + '       g   i     EL; i)z>
to_datetime specalized to the case where a 'unit' is passed.
T)extract_numpyzdatetime64[r   NiuFr   r   fignore)invalid)r   r   r   r   )overr   z cannot convert input with unit ''zM8[ns])r   r   unit_for_numericsr   r   r   )r5   r   r-   astyper   r   r   kindr   r   r   r   r   errstateint64isnanallr   _datar   r   r   array_to_datetimer7   r   r   r   )rw   r   r   r   r   rr   r   r   
int_valuesmaskr   errs   &&&&&       rR   r   r     s    4
0C #|$$jj;tfA./	jjo99>>T! **{4&2*?C'		2EL)#5A IYY^^s"X.. ZZ1
 /88C=Dz)*//11 0f &)T"'**	3CCC + ((8$CI**V%*0C"44"&	NC 3*Ffm,,
 &11)<F
99''.F M &&u-FMq ' LW$jj(-cFKK	L /.. + (5JJv.C   +* .:4&B +**sZ   I# & JLJ2#5JJJ/	2L=&L#L$L3LLLL	c                   VR8X  d   T p\        ^ 4      P                  4       pVR8w  d   \        R4      h W,
          p \         P                  P                  4       T,
          p\         P
                  P                  4       T,
          p\        P                  ! Y8  4      '       g   \        P                  ! Y8  4      '       d   \        T R24      h T # \        V 4      '       gI   \        V 4      '       g8   \        \        P                  ! V 4      4      '       g   \        RV  RV R	24      h \        P                  ! V4      '       g   \        P                  ! V4      '       d   \        WR
7      pM\        V4      p VP                  e   \        RV R24      hV\        ^ 4      ,
          p	V	\        ^VR
7      ,          p
\!        V 4      '       dB   \#        V \$        \&        \        P(                  34      '       g   \        P                  ! V 4      p W
,           p V #   \         d   p\        R4      ThRp?ii ; i  \         d   p\        RT R24      ThRp?i\         d   p\        RT R24      ThRp?ii ; i)aV  
Helper function for to_datetime.
Adjust input argument to the specified origin

Parameters
----------
arg : list, tuple, ndarray, Series, Index
    date to be adjusted
origin : 'julian' or Timestamp
    origin offset for the arg
unit : str
    passed unit from to_datetime, must be 'D'

Returns
-------
ndarray or scalar of adjusted date(s)
julianDz$unit must be 'D' for origin='julian'z3incompatible 'arg' type for given 'origin'='julian'Nz% is Out of Bounds for origin='julian'r   z!' is not compatible with origin='z+'; it must be numeric with a unit specifiedr   zorigin z is Out of Boundsz# cannot be converted to a Timestampzorigin offset z must be tz-naive)r   to_julian_dater   r   maxminr   anyr   r$   r"   r'   r   r   r   r   r&   r   r+   r6   r   )rw   originr   originalj0r   j_maxj_minoffset	td_offsetioffsets   &&&        rR   _adjust_to_originr  7  s0   $ q\((*3;CDD	(C ,,.3,,.366#+"&&"5"5%*AB  #6N JA __2B2::c?2S2SC59& B; ; 
	~~f%%f)=)="65"6* 99 ~fX5FGHHYq\)	 y66 Zi

5S%T%T**S/CmJ_  	E	8 # 	T%x7H&IJPSS 	&!DE	sS   H /H> H> 'H> 4H> H;*H66H;>I<	II<&I<'I77I<c               @    V ^8  d   QhRRRRRRRRRRR	R
RRRR
RRRR/
# )r`   rw   rA   r   r   ra   r{   r   r   re   rd   r   r   r   rc   r   rI   )re   s   "rR   rf   rf     sl      	   	
 
     rQ   c
                    R # NrI   
rw   r   ra   r   r   re   r   r   r   r   s
   &&&&&&&&&&rR   to_datetimer    s     rQ   c               @    V ^8  d   QhRRRRRRRRRRR	R
RRRR
RRRR/
# )r`   rw   zSeries | DictConvertibler   r   ra   r{   r   r   re   rd   r   r   r   rc   r>   rI   )re   s   "rR   rf   rf     sl      	!   	
 
     rQ   c
                    R # r  rI   r  s
   &&&&&&&&&&rR   r  r    s     rQ   c               @    V ^8  d   QhRRRRRRRRRRR	R
RRRR
RRRR/
# )r`   rw   z list | tuple | Index | ArrayLiker   r   ra   r{   r   r   re   rd   r   r   r   rc   r7   rI   )re   s   "rR   rf   rf     sl      	)   	
 
     rQ   c
                    R # r  rI   r  s
   &&&&&&&&&&rR   r  r    s     rQ   r   unixc               D    V ^8  d   QhRRRRRRRRRRR	R
RRRR
RRRRRR/# )r`   rw   z2DatetimeScalarOrArrayConvertible | DictConvertibler   r   ra   r{   r   r   re   rd   r   zbool | lib.NoDefaultr   r   rn   r   rc   z1DatetimeIndex | Series | DatetimeScalar | NaTTyperI   )re   s   "rR   rf   rf     s     I I	;I I I 	I
 
I I  I I I I 7IrQ   c
           
        V\         P                  Jd   VR9   d   \        R4      hV f   \        # VR8w  d   \	        WV4      p \        \        VVVVVVR7      p
\        V \        4      '       d?   T pV'       d3   V P                  e   V P                  R4      pV# V P                  R4      pV# \        V \        4      '       do   \        WW4      pVP                  '       g   V P                  V4      pV# V
! V P                   V4      pV P#                  WP$                  V P&                  R7      p V# \        V \(        \*        P,                  34      '       d   \/        WV4      pV# \        V \0        4      '       dO   \        WW4      pVP                  '       g   \3        WV P&                  R7      pV# V
! WV P&                  R7      p V# \5        V 4      '       du    \7        \8        \:        \<        \>        \@        PB                  R\0        3,          V 4      p\        WW4      pVP                  '       g   \3        XV4      pV# V
! XV4      p V# V
! \@        PL                  ! V .4      V4      ^ ,          p\        V \N        4      '       d,   \        V\@        PP                  4      '       d   \O        V4      pV#   \D         d     TR8X  d   h ^ R	I#H$p T! . \J        R
7      p Li ; i)a1  
Convert argument to datetime.

This function converts a scalar, array-like, :class:`Series` or
:class:`DataFrame`/dict-like to a pandas datetime object.

Parameters
----------
arg : int, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like
    The object to convert to a datetime. If a :class:`DataFrame` is provided, the
    method expects minimally the following columns: :const:`"year"`,
    :const:`"month"`, :const:`"day"`. The column "year"
    must be specified in 4-digit format.
errors : {'raise', 'coerce'}, default 'raise'
    - If :const:`'raise'`, then invalid parsing will raise an exception.
    - If :const:`'coerce'`, then invalid parsing will be set as :const:`NaT`.
dayfirst : bool, default False
    Specify a date parse order if `arg` is str or is list-like.
    If :const:`True`, parses dates with the day first, e.g. :const:`"10/11/12"`
    is parsed as :const:`2012-11-10`.

    .. warning::

        ``dayfirst=True`` is not strict, but will prefer to parse
        with day first.

yearfirst : bool, default False
    Specify a date parse order if `arg` is str or is list-like.

    - If :const:`True` parses dates with the year first, e.g.
      :const:`"10/11/12"` is parsed as :const:`2010-11-12`.
    - If both `dayfirst` and `yearfirst` are :const:`True`, `yearfirst` is
      preceded (same as :mod:`dateutil`).

    .. warning::

        ``yearfirst=True`` is not strict, but will prefer to parse
        with year first.

utc : bool, default False
    Control timezone-related parsing, localization and conversion.

    - If :const:`True`, the function *always* returns a timezone-aware
      UTC-localized :class:`Timestamp`, :class:`Series` or
      :class:`DatetimeIndex`. To do this, timezone-naive inputs are
      *localized* as UTC, while timezone-aware inputs are *converted* to UTC.

    - If :const:`False` (default), inputs will not be coerced to UTC.
      Timezone-naive inputs will remain naive, while timezone-aware ones
      will keep their time offsets. Limitations exist for mixed
      offsets (typically, daylight savings), see :ref:`Examples
      <to_datetime_tz_examples>` section for details.

    See also: pandas general documentation about `timezone conversion and
    localization
    <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
    #time-zone-handling>`_.

format : str, default None
    The strftime to parse time, e.g. :const:`"%d/%m/%Y"`. See
    `strftime documentation
    <https://docs.python.org/3/library/datetime.html
    #strftime-and-strptime-behavior>`_ for more information on choices, though
    note that :const:`"%f"` will parse all the way up to nanoseconds.
    You can also pass:

    - "ISO8601", to parse any `ISO8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
      time string (not necessarily in exactly the same format);
    - "mixed", to infer the format for each element individually. This is risky,
      and you should probably use it along with `dayfirst`.

    .. note::

        If a :class:`DataFrame` is passed, then `format` has no effect.

exact : bool, default True
    Control how `format` is used:

    - If :const:`True`, require an exact `format` match.
    - If :const:`False`, allow the `format` to match anywhere in the target
      string.

    Cannot be used alongside ``format='ISO8601'`` or ``format='mixed'``.
unit : str, default 'ns'
    The unit of the arg (D,s,ms,us,ns) denote the unit, which is an
    integer or float number. This will be based off the origin.
    Example, with ``unit='ms'`` and ``origin='unix'``, this would calculate
    the number of milliseconds to the unix epoch start.
origin : scalar, default 'unix'
    Define the reference date. The numeric values would be parsed as number
    of units (defined by `unit`) since this reference date.

    - If :const:`'unix'` (or POSIX) time; origin is set to 1970-01-01.
    - If :const:`'julian'`, unit must be :const:`'D'`, and origin is set to
      beginning of Julian Calendar. Julian day number :const:`0` is assigned
      to the day starting at noon on January 1, 4713 BC.
    - If Timestamp convertible (Timestamp, dt.datetime, np.datetimt64 or date
      string), origin is set to Timestamp identified by origin.
    - If a float or integer, origin is the difference
      (in units determined by the ``unit`` argument) relative to 1970-01-01.
cache : bool, default True
    If :const:`True`, use a cache of unique, converted dates to apply the
    datetime conversion. May produce significant speed-up when parsing
    duplicate date strings, especially ones with timezone offsets. The cache
    is only used when there are at least 50 values. The presence of
    out-of-bounds values will render the cache unusable and may slow down
    parsing.

Returns
-------
datetime
    If parsing succeeded.
    Return type depends on input (types in parenthesis correspond to
    fallback in case of unsuccessful timezone or out-of-range timestamp
    parsing):

    - scalar: :class:`Timestamp` (or :class:`datetime.datetime`)
    - array-like: :class:`DatetimeIndex` (or :class:`Series` with
      :class:`object` dtype containing :class:`datetime.datetime`)
    - Series: :class:`Series` of :class:`datetime64` dtype (or
      :class:`Series` of :class:`object` dtype containing
      :class:`datetime.datetime`)
    - DataFrame: :class:`Series` of :class:`datetime64` dtype (or
      :class:`Series` of :class:`object` dtype containing
      :class:`datetime.datetime`)

Raises
------
ParserError
    When parsing a date from string fails.
ValueError
    When another datetime conversion error happens. For example when one
    of 'year', 'month', day' columns is missing in a :class:`DataFrame`, or
    when a Timezone-aware :class:`datetime.datetime` is found in an array-like
    of mixed time offsets, and ``utc=False``, or when parsing datetimes
    with mixed time zones unless ``utc=True``. If parsing datetimes with mixed
    time zones, please specify ``utc=True``.

See Also
--------
DataFrame.astype : Cast argument to a specified dtype.
to_timedelta : Convert argument to timedelta.
convert_dtypes : Convert dtypes.

Notes
-----

Many input types are supported, and lead to different output types:

- **scalars** can be int, float, str, datetime object (from stdlib :mod:`datetime`
  module or :mod:`numpy`). They are converted to :class:`Timestamp` when
  possible, otherwise they are converted to :class:`datetime.datetime`.
  None/NaN/null scalars are converted to :const:`NaT`.

- **array-like** can contain int, float, str, datetime objects. They are
  converted to :class:`DatetimeIndex` when possible, otherwise they are
  converted to :class:`Index` with :class:`object` dtype, containing
  :class:`datetime.datetime`. None/NaN/null entries are converted to
  :const:`NaT` in both cases.

- **Series** are converted to :class:`Series` with :class:`datetime64`
  dtype when possible, otherwise they are converted to :class:`Series` with
  :class:`object` dtype, containing :class:`datetime.datetime`. None/NaN/null
  entries are converted to :const:`NaT` in both cases.

- **DataFrame/dict-like** are converted to :class:`Series` with
  :class:`datetime64` dtype. For each row a datetime is created from assembling
  the various dataframe columns. Column keys can be common abbreviations
  like ['year', 'month', 'day', 'minute', 'second', 'ms', 'us', 'ns']) or
  plurals of the same.

The following causes are responsible for :class:`datetime.datetime` objects
being returned (possibly inside an :class:`Index` or a :class:`Series` with
:class:`object` dtype) instead of a proper pandas designated type
(:class:`Timestamp`, :class:`DatetimeIndex` or :class:`Series`
with :class:`datetime64` dtype):

- when any input element is before :const:`Timestamp.min` or after
  :const:`Timestamp.max`, see `timestamp limitations
  <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
  #timeseries-timestamp-limits>`_.

- when ``utc=False`` (default) and the input is an array-like or
  :class:`Series` containing mixed naive/aware datetime, or aware with mixed
  time offsets. Note that this happens in the (quite frequent) situation when
  the timezone has a daylight savings policy. In that case you may wish to
  use ``utc=True``.

Examples
--------

**Handling various input formats**

Assembling a datetime from multiple columns of a :class:`DataFrame`. The keys
can be common abbreviations like ['year', 'month', 'day', 'minute', 'second',
'ms', 'us', 'ns']) or plurals of the same

>>> df = pd.DataFrame({"year": [2015, 2016], "month": [2, 3], "day": [4, 5]})
>>> pd.to_datetime(df)
0   2015-02-04
1   2016-03-05
dtype: datetime64[us]

Using a unix epoch time

>>> pd.to_datetime(1490195805, unit="s")
Timestamp('2017-03-22 15:16:45')
>>> pd.to_datetime(1490195805433502912, unit="ns")
Timestamp('2017-03-22 15:16:45.433502912')

.. warning:: For float arg, precision rounding might happen. To prevent
    unexpected behavior use a fixed-width exact type.

Using a non-unix epoch origin

>>> pd.to_datetime([1, 2, 3], unit="D", origin=pd.Timestamp("1960-01-01"))
DatetimeIndex(['1960-01-02', '1960-01-03', '1960-01-04'],
              dtype='datetime64[s]', freq=None)

**Differences with strptime behavior**

:const:`"%f"` will parse all the way up to nanoseconds.

>>> pd.to_datetime("2018-10-26 12:00:00.0000000011", format="%Y-%m-%d %H:%M:%S.%f")
Timestamp('2018-10-26 12:00:00.000000001')

**Non-convertible date/times**

Passing ``errors='coerce'`` will force an out-of-bounds date to :const:`NaT`,
in addition to forcing non-dates (or non-parseable dates) to :const:`NaT`.

>>> pd.to_datetime("invalid for Ymd", format="%Y%m%d", errors="coerce")
NaT

.. _to_datetime_tz_examples:

**Timezones and time offsets**

The default behaviour (``utc=False``) is as follows:

- Timezone-naive inputs are converted to timezone-naive :class:`DatetimeIndex`:

>>> pd.to_datetime(["2018-10-26 12:00:00", "2018-10-26 13:00:15"])
DatetimeIndex(['2018-10-26 12:00:00', '2018-10-26 13:00:15'],
              dtype='datetime64[us]', freq=None)

- Timezone-aware inputs *with constant time offset* are converted to
  timezone-aware :class:`DatetimeIndex`:

>>> pd.to_datetime(["2018-10-26 12:00 -0500", "2018-10-26 13:00 -0500"])
DatetimeIndex(['2018-10-26 12:00:00-05:00', '2018-10-26 13:00:00-05:00'],
              dtype='datetime64[us, UTC-05:00]', freq=None)

- However, timezone-aware inputs *with mixed time offsets* (for example
  issued from a timezone with daylight savings, such as Europe/Paris)
  are **not successfully converted** to a :class:`DatetimeIndex`.
  Parsing datetimes with mixed time zones will raise a ValueError unless
  ``utc=True``:

>>> pd.to_datetime(
...     ["2020-10-25 02:00 +0200", "2020-10-25 04:00 +0100"]
... )  # doctest: +SKIP
ValueError: Mixed timezones detected. Pass utc=True in to_datetime
or tz='UTC' in DatetimeIndex to convert to a common timezone.

- To create a :class:`Series` with mixed offsets and ``object`` dtype, please use
  :meth:`Series.apply` and :func:`datetime.datetime.strptime`:

>>> import datetime as dt
>>> ser = pd.Series(["2020-10-25 02:00 +0200", "2020-10-25 04:00 +0100"])
>>> ser.apply(lambda x: dt.datetime.strptime(x, "%Y-%m-%d %H:%M %z"))
0    2020-10-25 02:00:00+02:00
1    2020-10-25 04:00:00+01:00
dtype: object

- A mix of timezone-aware and timezone-naive inputs will also raise a ValueError
  unless ``utc=True``:

>>> from datetime import datetime
>>> pd.to_datetime(
...     ["2020-01-01 01:00:00-01:00", datetime(2020, 1, 1, 3, 0)]
... )  # doctest: +SKIP
ValueError: Mixed timezones detected. Pass utc=True in to_datetime
or tz='UTC' in DatetimeIndex to convert to a common timezone.

|

Setting ``utc=True`` solves most of the above issues:

- Timezone-naive inputs are *localized* as UTC

>>> pd.to_datetime(["2018-10-26 12:00", "2018-10-26 13:00"], utc=True)
DatetimeIndex(['2018-10-26 12:00:00+00:00', '2018-10-26 13:00:00+00:00'],
              dtype='datetime64[us, UTC]', freq=None)

- Timezone-aware inputs are *converted* to UTC (the output represents the
  exact same datetime, but viewed from the UTC time offset `+00:00`).

>>> pd.to_datetime(["2018-10-26 12:00 -0530", "2018-10-26 12:00 -0500"], utc=True)
DatetimeIndex(['2018-10-26 17:30:00+00:00', '2018-10-26 17:00:00+00:00'],
              dtype='datetime64[us, UTC]', freq=None)

- Inputs can contain both string or datetime, the above
  rules still apply

>>> pd.to_datetime(["2018-10-26 12:00", datetime(2020, 1, 1, 18)], utc=True)
DatetimeIndex(['2018-10-26 12:00:00+00:00', '2020-01-01 18:00:00+00:00'],
              dtype='datetime64[us, UTC]', freq=None)
z8Cannot use 'exact' when 'format' is 'mixed' or 'ISO8601'r  )r   r   ra   r   r   r   r   )r   r   r   r>   r   r   r   >   r   ISO8601))r   
no_defaultr   r   r  r   r   r   r   r   r   r   r+   r   emptyr   r   _constructorr   r   r*   r   MutableMapping_assemble_from_unit_mappingsr6   r   r&   r   r   r   r   r1   r   r   r   r   r>   r   r   r{   bool_)rw   r   ra   r   r   re   r   r   r   r   r   r   r   valuesargcr>   s   &&&&&&&&&&      rR   r  r    s   D
 CNN"v1E'ESTT
{
T2# #y!!vv!.b M_ /^ M] 
C	#	#"3H   WW[)FV MS &ckk6:F%%fIICHH%MFP MO 
C,(:(:;	<	<-c3?L MK 
C		"3H   +C388LFD MA &cAF@ M? 
c			3
 dE>2::xNOQTD 'tUMK    +D+>F M &dF3F M ""((C5/6:1=c4  Z%A%A&\F
 M+ # 	3  % 62K	3s   AJ7 7'K! K!rF   yearsrG   monthsrH   daysrV   hrW   rX   mrY   rZ   sr[   r\   millisecondmillisecondsr]   microsecondmicrosecondsr^   
nanosecondnanosecondsc               $    V ^8  d   QhRRRRRR/# )r`   r   r   r   r{   rc   r>   rI   )re   s   "rR   rf   rf   V  s)     ` `%`,0``rQ   c                  aa ^ RI HpHoHp V! V 4      p V P                  P
                  '       g   \        R4      hR pV P                  4        Uu/ uF  qfV! V4      bK  	  ppVP                  4        UUu/ uF  w  rhWbK	  	  p	pp. ROp
\        V
4      \        V	P                  4       4      ,
          p\        V4      '       d*   RP                  \        V4      4      p\        RV R	24      h\        V	P                  4       4      \        \        P                  4       4      ,
          p\        V4      '       d*   RP                  \        V4      4      p\        R
V R24      hVV3R lpV! W	R,          ,          4      R,          V! W	R,          ,          4      ^d,          ,           V! W	R,          ,          4      ,           p \        VRSVR7      p. ROpT FC  pT	P#                  T4      pTf   K  TT 9   g   K#   TT! T! T T,          4      TSR7      ,          pKE  	  T# u upi u uppi   \         \        3 d   p\        RT 24      ThRp?ii ; i  \         \        3 d   p\        RT RT 24      ThRp?ii ; i)a  
assemble the unit specified fields from the arg (DataFrame)
Return a Series for actual parsing

Parameters
----------
arg : DataFrame
errors : {'raise', 'coerce'}, default 'raise'

    - If :const:`'raise'`, then invalid parsing will raise an exception
    - If :const:`'coerce'`, then invalid parsing will be set as :const:`NaT`
utc : bool
    Whether to convert/localize timestamps to UTC.

Returns
-------
Series
)r=   
to_numericto_timedeltaz#cannot assemble with duplicate keysc                    V \         9   d   \         V ,          # V P                  4       \         9   d   \         V P                  4       ,          # V # r  )	_unit_maplower)values   &rR   r   '_assemble_from_unit_mappings.<locals>.fv  s;    IU## ;;=I%U[[]++rQ   rF   rG   rH   ,zNto assemble mappings requires at least that [year, month, day] be specified: [z] is missingz9extra keys have been passed to the datetime assemblage: [r   c                   < S! V SR 7      p \        V P                  4      '       d   V P                  R4      p \        V P                  4      '       d   V P                  R4      p V # ))r   float64r   )r#   r   r   r%   )r  r   r'  s   &rR   r   ,_assemble_from_unit_mappings.<locals>.coerce  sR    F62 &,,'']]9-F FLL))]]7+FrQ   i'  z%Y%m%d)re   r   r   zcannot assemble the datetimes: N)r   r   zcannot assemble the datetimes [z]: )rF   rG   rH   )r  r  r  r\   r]   r^   )r   r=   r'  r(  columnsr   r   keysitemsr   r}   joinsortedr*  r  r  r   get)rw   r   r   r=   r(  r   kr   vunit_revrequiredreq	_requiredexcess_excessr   r  r   unitsur,  r'  s   &f&                  @rR   r  r  V  sS   *  C.C;;   >?? !XXZ(ZqtGZD(!%.H. (H
h-#hmmo.
.C
3xxHHVC[)	11:<I
 	
 !C	(8(8(:$;;F
6{{((6&>*GyPQR
 	
 	sF#$%-
g&'
(3
.	/
e_%
&	' 
KVHVM  AEQ#,vc%j'9&QQ	  Mm ).P z" K:3%@AsJK z*  5eWCuEs<   H 7H%H+ ;I+I<III;$I66I;)F)gffffff?N)FNr  )NFNr   NNT)	.........)r   r   r  ){__conditional_annotations__
__future__r   collectionsr   datetimer   	functoolsr   	itertoolsr   typingr   r	   r
   r   r   r   ro   numpyr   pandas._libsr   r   pandas._libs.tslibsr   r   r   r   r   r   r   r   r   pandas._libs.tslibs.conversionr   pandas._libs.tslibs.parsingr   r   pandas._libs.tslibs.strptimer   pandas._typingr   r   r   pandas.util._decoratorsr   pandas.util._exceptionsr    pandas.core.dtypes.commonr!   r"   r#   r$   r%   r&   r'   pandas.core.dtypes.dtypesr(   r)   pandas.core.dtypes.genericr*   r+   pandas.arraysr,   r-   r.   pandas.core.algorithmsr/   pandas.core.arraysr0   pandas.core.arrays.baser1   pandas.core.arrays.datetimesr2   r3   r4   pandas.core.constructionr5   pandas.core.indexes.baser6   pandas.core.indexes.datetimesr7   collections.abcr8   r9   pandas._libs.tslibs.nattyper:   pandas._libs.tslibs.timedeltasr;   r<   r   r=   r>   r   r   r?   rO   ry   rn   r@   r   rA   rB   rC   rE   rU   DictConvertibler~   ru   r   r   r   r   r   r   r   r  r  r  r*  r  __all__)rB  s   @rR   <module>rb     s   " "       	 	 	 E 8 
 / 4  
 
 * 2 2 
 3 * 7
 4:' #Ul\9 ) 9CK	 "TMBMM9	 9.<?O.O  ) O!&\E&#+,>>M My 	'u 	 (+56 .9x/d<:C4G9TD8M`HV 
 
 
 
 
 
 H $+"%..I IZ
FV W g	
 
5 E C S c s c s 	$ 4 D  	$!" 4#$ D$$4+	2`FrQ   