
    Mh"J                    B   S SK Jr  S SKJrJr  S SKJr  S SKrS SKrS SK	J
r  S SK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#J$r$J%r%  S SK&J's  J(r)  S SK*J's  J+s  J,r-  S SK*J.r.  S SK/J0r0  S SK1J2r2J3r3  S SK4J5r5  \(       a  S SK6J7r7  S SK8J9r9J:r:J;r;J<r<  \=" \-R|                  5      r>\>R                  SS05        SS0r@S rA\5" / SQ\"R                  -   \"SS9\5" S/\"5       " S S\05      5       5       rC     S!     S"S  jjrDg)#    )annotations)datetime	timedelta)TYPE_CHECKINGN)index)
BaseOffsetNaTPeriod
ResolutionTick)OFFSET_TO_PERIOD_FREQSTR)cache_readonlydoc)find_stack_level)
is_integer)PeriodDtype)	ABCSeries)is_valid_na_for_dtype)PeriodArrayperiod_arrayraise_on_incompatiblevalidate_dtype_freq)maybe_extract_name)DatetimeIndexOpsMixin)DatetimeIndexIndex)inherit_names)Hashable)DtypeDtypeObjSelfnpttarget_klasszPeriodIndex or list of Periodsklassr   c                    UR                  S5      nUR                  S:X  a9  UR                  SS 5      n[        U5      n[        X$S9nU R                  " U40 UD6$ U " U40 UD6$ )Ndataint64freqdtype)popr*   r   r   _simple_new)clsdvaluesr(   r*   s        L/var/www/html/env/lib/python3.13/site-packages/pandas/core/indexes/period.py_new_PeriodIndexr1   D   sc    UU6]F||wuuVT"D!V1v+++6Q    )strftime
start_timeend_timeT)wrapis_leap_yearc            
      T  ^  \ rS rSr% SrSrS\S'   S\S'   S\S	'   \rS
r	\
S(S j5       r\S)S j5       r\" \R                  4SSS.\D6S*S+S jj5       r\" \R"                  5      S,S-S jj5       r\
\" \R$                  R&                  5      S.S j5       5       r\
\" \R(                  R&                  5      S.S j5       5       r\
\" \R*                  R&                  5      S.S j5       5       r      S/       S0S jjr\SSSSSSSSS. S1S jj5       r\SS.S1S jj5       r\
S2S j5       rS3S jrS4S jrS5U 4S jjr\
S6S j5       r\
S7S j5       rU 4S  jr S! r!S8S" jr"S9S# jr#\" \$RJ                  5      S:U 4S$ jj5       r%S;S% jr&\" \$RN                  5      S<S=S& jj5       r'S'r(U =r)$ )>PeriodIndexP   a  
Immutable ndarray holding ordinal values indicating regular periods in time.

Index keys are boxed to Period objects which carries the metadata (eg,
frequency information).

Parameters
----------
data : array-like (1d int np.ndarray or PeriodArray), optional
    Optional period-like data to construct index with.
copy : bool
    Make a copy of input ndarray.
freq : str or period object, optional
    One of pandas period strings or corresponding objects.
year : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
month : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
quarter : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
day : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
hour : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
minute : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
second : int, array, or Series, default None

    .. deprecated:: 2.2.0
       Use PeriodIndex.from_fields instead.
dtype : str or PeriodDtype, default None

Attributes
----------
day
dayofweek
day_of_week
dayofyear
day_of_year
days_in_month
daysinmonth
end_time
freq
freqstr
hour
is_leap_year
minute
month
quarter
qyear
second
start_time
week
weekday
weekofyear
year

Methods
-------
asfreq
strftime
to_timestamp
from_fields
from_ordinals

See Also
--------
Index : The base pandas Index type.
Period : Represents a period of time.
DatetimeIndex : Index with datetime64 data.
TimedeltaIndex : Index of timedelta64 data.
period_range : Create a fixed-frequency PeriodIndex.

Examples
--------
>>> idx = pd.PeriodIndex.from_fields(year=[2000, 2002], quarter=[1, 3])
>>> idx
PeriodIndex(['2000Q1', '2002Q3'], dtype='period[Q-DEC]')
periodindexr   _datar   r(   r   r*   Tc                "    [         R                  $ N)libindexPeriodEngineselfs    r0   _engine_typePeriodIndex._engine_type   s    $$$r2   c                .    U R                   R                  $ r>   )r*   _resolution_objrA   s    r0   rF   PeriodIndex._resolution_obj   s     zz)))r2   zpandas.arrays.PeriodArray)other
other_nameNc                |    U R                   R                  X5      n[        U 5      R                  X0R                  S9$ Nname)r<   asfreqtyper,   rM   rB   r(   howarrs       r0   rN   PeriodIndex.asfreq   s4     jj*Dz%%c		%::r2   c                t    U R                   R                  X5      n[        R                  " X0R                  S9$ rK   )r<   to_timestampr   r,   rM   rP   s       r0   rU   PeriodIndex.to_timestamp   s+    jj%%d0((99==r2   c                R    [        U R                  R                  U R                  S9$ rK   )r   r<   hourrM   rA   s    r0   rX   PeriodIndex.hour   s     TZZ__49955r2   c                R    [        U R                  R                  U R                  S9$ rK   )r   r<   minuterM   rA   s    r0   r[   PeriodIndex.minute        TZZ&&TYY77r2   c                R    [        U R                  R                  U R                  S9$ rK   )r   r<   secondrM   rA   s    r0   r_   PeriodIndex.second   r]   r2   c                   1 SknS n	U(       d'  [        U[        [        45      (       a  UR                  n	[	        U5      R                  U5      (       d.  [        [        [	        U5      U-
  5      5      n
[        SU
 35      e[        U5      (       a"  [        R                  " S[        [        5       S9  Ub"  [        R                  " S[        [        5       S9  [        XaU 5      nUc>  Uc;  U(       d  U R                  S 5        U R                   " S0 UDSU0D6R"                  nSnOU(       a  Ub  [%        S5      e[%        S	5      e['        XC5      nU(       a1  [        X5      (       a!  UR(                  U:w  a  UR+                  U5      nUc;  Ub8  [,        R.                  " U[,        R0                  S
9n[3        U5      n[5        X$S
9nOUb  Ub  [%        S5      e[7        XS9nU(       a  UR9                  5       nU R;                  XU	S9$ )N>   dayrX   yearmonthr[   r_   quarterz-__new__() got an unexpected keyword argument zXConstructing PeriodIndex from fields is deprecated. Use PeriodIndex.from_fields instead.)
stacklevelzThe 'ordinal' keyword in PeriodIndex is deprecated and will be removed in a future version. Use PeriodIndex.from_ordinals instead.r(   Fz Cannot pass both data and fieldsz#Cannot pass both ordinal and fieldsr)   z!Cannot pass both data and ordinal)r&   r(   )rM   refs )
isinstancer   r   _referencessetissubsetnextiter	TypeErrorlenwarningswarnFutureWarningr   r   _raise_scalar_data_errorfrom_fieldsr<   
ValueErrorr   r(   rN   npasarrayr'   r   r   r   copyr,   )r-   r&   ordinalr(   r*   ry   rM   fieldsvalid_field_setrg   arguments              r0   __new__PeriodIndex.__new__   s   
 
4%);<<##D6{##O44DV!>?@HKH:VWW[[MM3+-	 MM +- "$c2<GO,,T2??7V7$7==DD !CDDBCC 'u3D
 
4--$))t2C {{4(| 3**WBHH=#D)"78!g&9 !DEE $999;DtT::r2   )rc   re   rd   rb   rX   r[   r_   r(   c                   UUUUUUUS.n	U	R                  5        V
Vs0 s H  u  pUc  M
  X_M     n	n
n[        R                  " XS9nU R                  U5      $ s  snn
f )N)rc   re   rd   rb   rX   r[   r_   )r{   r(   )itemsr   _from_fieldsr,   )r-   rc   re   rd   rb   rX   r[   r_   r(   r{   keyvaluerR   s                r0   ru   PeriodIndex.from_fieldsA  si     
 06||~S~*#*~S&&f@s## Ts
   	AArL   c                   [         R                  " U[         R                  S9n[        U5      n[        R
                  " XS9nU R                  XSS9$ )Nr)   rL   )rw   rx   r'   r   r   r,   )r-   ordinalsr(   rM   r*   r&   s         r0   from_ordinalsPeriodIndex.from_ordinals[  sA    ::hbhh7D!&&x=t//r2   c                4    [         R                  " U [        S9$ )Nr)   )rw   rx   objectrA   s    r0   r/   PeriodIndex.valuese  s    zz$f--r2   c                   [        U[        [        R                  [        [        R
                  45      (       a=  [        U R                  [        5      (       a  U R                  R                  U5      nU$ Oy[        U[        5      (       a;  UR                  U R                  R                  :X  a  UR                  $ [        X5      e[        U5      (       a  [        U[        5      (       d   eU$ [        U S5      e)ae  
Convert timedelta-like input to an integer multiple of self.freq

Parameters
----------
other : timedelta, np.timedelta64, DateOffset, int, np.ndarray

Returns
-------
converted : int, np.ndarray[int64]

Raises
------
IncompatibleFrequency : if the input cannot be written as a multiple
    of self.freq.  Note IncompatibleFrequency subclasses ValueError.
N)ri   r   rw   timedelta64r   ndarrayr(   r<    _check_timedeltalike_freq_compatr   basenr   r   int)rB   rH   deltas      r0   _maybe_convert_timedelta$PeriodIndex._maybe_convert_timedeltai  s    " eirzzJKK$))T**

CCEJ + z**zzTYY^^+ww'44eS))))L $D$//r2   c                     U R                   U:H  $ )z6
Can we compare values of the given dtype to our own?
r)   )rB   r*   s     r0   _is_comparable_dtype PeriodIndex._is_comparable_dtype  s     zzU""r2   c                   > [        U[        5      (       a  [        UR                  U R                  S9nO [        U[        5      (       d  [        S5      e[        TU ]  X5      $ )za
where : array of timestamps
mask : np.ndarray[bool]
    Array of booleans where data is not NA.
r(   z6asof_locs `where` must be DatetimeIndex or PeriodIndex)ri   r   r9   _valuesr(   ro   super	asof_locs)rB   wheremask	__class__s      r0   r   PeriodIndex.asof_locs  sO     e]++DII>EE;//TUUw --r2   c                    [        U 5      S:X  a  gU R                  (       d  [        S5      eU R                  n[	        USS USS -
  S:  R                  5       5      $ )zq
Returns True if this PeriodIndex is range-like in that all Periods
between start and end are present, in order.
r   TzIndex is not monotonic   N   )rp   is_monotonic_increasingrv   asi8boolall)rB   r/   s     r0   is_fullPeriodIndex.is_full  sZ     t9>++566fQRj6#2;.!388:;;r2   c                    g)Nperiodrh   rA   s    r0   inferred_typePeriodIndex.inferred_type  s     r2   c                |   > [         TU ]  X5      nU R                  UR                  :X  a  U R                  U5      nU$ r>   )r   _convert_tolerancer*   r   )rB   	tolerancetargetr   s      r0   r   PeriodIndex._convert_tolerance  s:    
 G.yA	::%55i@Ir2   c                    UnU R                  U5        [        XR                  5      (       a  [        nO[	        U[
        5      (       ah   U R                  U5      u  p4U R                  U5      (       a   U R                  XC5      $ X@R                  :X  a  U R                  U5      nOd[        U5      e[	        U[        5      (       a  U R                  U5        O2[	        U[        5      (       a  U R                  U5      nO[        U5      e [         R"                  " X5      $ ! [         a  n[        SU S3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)aC  
Get integer location for requested label.

Parameters
----------
key : Period, NaT, str, or datetime
    String or datetime key must be parsable as Period.

Returns
-------
loc : int or ndarray[int64]

Raises
------
KeyError
    Key is not present in the index.
TypeError
    If key is listlike or otherwise not hashable.
zCannot interpret 'z' as periodN)_check_indexing_errorr   r*   r	   ri   str_parse_with_resorv   KeyError_can_partial_date_slice_partial_date_slicerF   _cast_partial_indexing_scalarr
   _disallow_mismatched_indexingr   r   get_loc)rB   r   orig_keyparsedresoerrs         r0   r   PeriodIndex.get_loc  sa   ( ""3' jj11CS!!O#44S9
 ++D11133DAA +++ 88@sm#V$$..s3X&&44S9C 3-	.==++9  O!3C5DE3NO   1"3-S01,  	.8$#-	.sH   D" 5E E" "
E,D<<E
EEE"
E=,E88E=c                N    UR                   U R                  :w  a  [        U5      eg r>   )_dtyper*   r   )rB   r   s     r0   r   )PeriodIndex._disallow_mismatched_indexing  s!    ::#3- $r2   c                j     [        XR                  S9nU$ ! [         a  n[        U5      UeS nAff = f)Nr   )r
   r(   rv   r   )rB   labelr   r   s       r0   r   )PeriodIndex._cast_partial_indexing_scalar  s:    	+E		2F   	+5/s*	+s    
2-2c                n   > [        U[        5      (       a  U R                  U5      n[        TU ]  X5      $ r>   )ri   r   r   r   _maybe_cast_slice_bound)rB   r   sider   s      r0   r   #PeriodIndex._maybe_cast_slice_bound  s0    eX&&66u=Ew.u;;r2   c                    [         R                  " UR                  UR                  5      n[        X#S9nUR	                  U R
                  SS9UR	                  U R
                  SS94$ )Nr   start)rQ   end)r   getattr_abbrevr
   rN   r(   )rB   r   r   r(   ivs        r0   _parsed_string_to_bounds$PeriodIndex._parsed_string_to_bounds  sW    '++D,<,<d>N>NOF&		$))	1299TYYE93RSSr2   c                T    Ub"  [        S[        U 5      R                   S35      eX-   $ )Nz%`freq` argument is not supported for z.shift)ro   rO   __name__)rB   periodsr(   s      r0   shiftPeriodIndex.shift  s6    7T
8K8K7LFS  ~r2   rh   )returnztype[libindex.PeriodEngine])r   r   )NE)rQ   r   r   r!   )Nr   )rQ   r   r   r   )r   r   )NNNNFN)r*   zDtype | Nonery   r   rM   Hashable | Noner   r!   )r   r!   )r   znpt.NDArray[np.object_])r   zint | npt.NDArray[np.int64])r*   r    r   r   )r   r   r   znpt.NDArray[np.bool_]r   z
np.ndarray)r   r   )r   r   )r   r
   r   None)r   r   r   r
   )r   r   )r   r   r   r   )r   N)r   r   r   r!   )*r   
__module____qualname____firstlineno____doc___typ__annotations__r   	_data_cls!_supports_partial_string_indexingpropertyrC   r   rF   r   rN   _shared_doc_kwargsrU   rX   fgetr[   r_   r~   classmethodru   r   r/   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__)r   s   @r0   r9   r9   P   sn   Zx D
I(,%% % * * 	)  	;; 		!	!"> #> 				6   6 			 	 !8 " 8 			 	 !8 " 8 " $U;
 U; U; U; 
U;n  $ 
$ $2 37 0 0 . . 0D#. 
< 
<  <.|  			6	67< 8<T
 			$	$% &r2   r9   c                   [         R                  " XU5      S:w  a  [        S5      eUc,  [        U [        5      (       d  [        U[        5      (       d  Sn[
        R                  " XX#5      u  pS[        U5      n[        XVS9n[        XTS9$ )aa  
Return a fixed frequency PeriodIndex.

The day (calendar) is the default frequency.

Parameters
----------
start : str, datetime, date, pandas.Timestamp, or period-like, default None
    Left bound for generating periods.
end : str, datetime, date, pandas.Timestamp, or period-like, default None
    Right bound for generating periods.
periods : int, default None
    Number of periods to generate.
freq : str or DateOffset, optional
    Frequency alias. By default the freq is taken from `start` or `end`
    if those are Period objects. Otherwise, the default is ``"D"`` for
    daily frequency.
name : str, default None
    Name of the resulting PeriodIndex.

Returns
-------
PeriodIndex

Notes
-----
Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
must be specified.

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
--------
>>> pd.period_range(start='2017-01-01', end='2018-01-01', freq='M')
PeriodIndex(['2017-01', '2017-02', '2017-03', '2017-04', '2017-05', '2017-06',
         '2017-07', '2017-08', '2017-09', '2017-10', '2017-11', '2017-12',
         '2018-01'],
        dtype='period[M]')

If ``start`` or ``end`` are ``Period`` objects, they will be used as anchor
endpoints for a ``PeriodIndex`` with frequency matching that of the
``period_range`` constructor.

>>> pd.period_range(start=pd.Period('2017Q1', freq='Q'),
...                 end=pd.Period('2017Q2', freq='Q'), freq='M')
PeriodIndex(['2017-03', '2017-04', '2017-05', '2017-06'],
            dtype='period[M]')
r   zOOf the three parameters: start, end, and periods, exactly two must be specifiedDr)   rL   )	comcount_not_nonerv   ri   r
   r   _generate_ranger   r9   )r   r   r   r(   rM   r&   r*   s          r0   period_ranger   #  s    p %g.!3,
 	
 |Zv66z#v?V?V,,UGJDEt)Dt''r2   )NNNNN)r   z
int | NonerM   r   r   r9   )E
__future__r   r   r   typingr   rq   numpyrw   pandas._libsr   r?   pandas._libs.tslibsr   r	   r
   r   r   pandas._libs.tslibs.dtypesr   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.periodr   r   r   r   pandas.core.commoncorecommonr   pandas.core.indexes.baseindexesr   ibaser    pandas.core.indexes.datetimeliker   pandas.core.indexes.datetimesr   r   pandas.core.indexes.extensionr   collections.abcr   pandas._typingr   r    r!   r"   dict_index_doc_kwargsupdater   r1   
_field_opsr9   r   rh   r2   r0   <module>r     s7   " !   *  @ 5 0 1 0 <  !   ( ( 7 B 8(  001    .*JK L] 	  *[-C-CC	
 -J' J .J\ 	 C( C(
 C( C(r2   