ó
    Ñ]j—º  ã                  ó  • S SK Jr  S SKJr  S SKrS SKJrJrJrJ	r	J
r
JrJr  S SKrS SKrS SKJrJr  S SKJr  S SKJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r$J%r%  S SK&J'r'J(r(  S S	K)J*r*  S S
K+J,r,J-r-  S SK.J/r/J0r0J1r1J2r2J3r3  S SK4J5r5J6r6J7r7  S SK8J9r9J:r:  S SK;J<r<J=r=  S SK>J?r?J@r@JArAJBrB  S SKCJDrD  S SKEJFrG  S SKHJIs  JJrK  \(       a0  S SKLJMrMJNrN  S SKOJPrPJQrQJRrRJSrSJTrTJUrUJVrVJWrW  S SK;JXrX  S SKEJYrYJZrZ  S SK[J\r\  \
" S\S9r]SS0r^S'S(S jjr_\7" S5       " S S\GRÀ                  \$RÂ                  5      5       rbS)S jrc  S*       S+S jjrd\S,S  j5       re\S-S! j5       re    S.S" jre S' S/S# jjrS0S1S$ jjrf        S2 S3S% jjrgS4S& jrhg)5é    )Úannotations)Ú	timedeltaN)ÚTYPE_CHECKINGÚAnyÚLiteralÚSelfÚTypeVarÚcastÚoverload)ÚalgosÚlib)ÚNDArrayBacked)Ú
BaseOffsetÚDayÚNaTÚNaTTypeÚ	TimedeltaÚadd_overflowsafeÚastype_overflowsafeÚdt64arr_to_periodarrÚget_unit_from_dtypeÚiNaTÚparsingÚperiodÚ	to_offset)Ú	FreqGroupÚPeriodDtypeBase)Úisleapyear_arr)ÚTickÚdelta_to_tick)ÚDIFFERENT_FREQÚIncompatibleFrequencyÚPeriodÚget_period_field_arrÚperiod_asfreq_arr)Úcache_readonlyÚdocÚ
set_module)Úensure_objectÚpandas_dtype)ÚDatetimeTZDtypeÚPeriodDtype)ÚABCIndexÚABCPeriodIndexÚ	ABCSeriesÚABCTimedeltaArray)Úisna)Údatetimelike)ÚCallableÚSequence)ÚAnyArrayLikeÚDtypeÚDtypeObjÚFillnaOptionsÚNpDtypeÚNumpySorterÚNumpyValueArrayLikeÚnpt)ÚExtensionDtype)ÚDatetimeArrayÚTimedeltaArray)ÚExtensionArrayÚBaseOffsetT)ÚboundÚklassÚPeriodArrayc                ó@   ^ • U 4S jnT Ul         Xl        [        U5      $ )Nc                ób   >• U R                   R                  n[        TU R                  U5      nU$ ©N)ÚdtypeÚ_dtype_coder$   Úasi8)ÚselfÚbaseÚresultÚnames      €ÚV/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pandas/core/arrays/period.pyÚfÚ_field_accessor.<locals>.fr   s)   ø€ Ø�z‰z×%Ñ%ˆÜ% d¨D¯I©I°tÓ<ˆØˆó    )Ú__name__Ú__doc__Úproperty)rN   Ú	docstringrP   s   `  rO   Ú_field_accessorrW   q   s    ø€ õð
 €A„JØ„IÜ�A‹;ÐrR   zpandas.arraysc                  ód  ^ • \ rS rSr% SrSrSr\R                  " \	5      r
\4rS rS\S'   Sr\SYS	 j5       r/ rS
\S'   S/rS
\S'   / SQrS
\S'   / SQrS
\S'   \\-   \-   rS
\S'   / SQrS
\S'   S\S'   SZS[S jjr\      S\S j5       r\SSS.     S]S jj5       r\SS.     S^S jj5       r\S_S`S jj5       r\S  5       r\SaS! j5       r    SbS" jr ScS# jr!SdS$ jr"\#SeS% j5       r$\SfS& j5       r%\SgS' j5       r& Sh     SiS( jjr'S_S) jr(\)" S*S+5      r*\)" S,S-5      r+\)" S.S/5      r,\)" S0S15      r-\)" S2S35      r.\)" S4S55      r/\)" S6S75      r0\0r1\)" S8S95      r2\2r3\3r4\)" S:S;5      =r5r6\)" S<S=5      r7\)" S>S?5      r8\)" S@SA5      r9\9r:\SjSB j5       r;SkSlSC jjr<SmSD jr=\>" SX0 \?DSESESF.D6SnSoSG jj5       r@SpSqSH jjrASISSJ.   SrSK jjrBSsStU 4SM jjjrC  Su       SvSN jjrDSSSLSO.         SwSP jjrE      SxSQ jrFSySR jrGU 4SS jrH    SzST jrISU rJSLSSV.     S{U 4SW jjjrKSXrLU =rM$ )|rD   é|   a¶  
Pandas ExtensionArray for storing Period data.

Users should use :func:`~pandas.array` to create new instances.

Parameters
----------
values : Union[PeriodArray, Series[period], ndarray[int], PeriodIndex]
    The data to store. These should be arrays that can be directly
    converted to ordinals without inference or copy (PeriodArray,
    ndarray[int64]), or a box around such an array (Series[period],
    PeriodIndex).
dtype : PeriodDtype, optional
    A PeriodDtype instance from which to extract a `freq`. If both
    `freq` and `dtype` are specified, then the frequencies must match.
copy : bool, default False
    Whether to copy the ordinals before storing.

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

Methods
-------
None

See Also
--------
Period: Represents a period of time.
PeriodIndex : Immutable Index for period data.
period_range: Create a fixed-frequency PeriodArray.
array: Construct a pandas array.

Notes
-----
There are two components to a PeriodArray

- ordinals : integer ndarray
- freq : pd.tseries.offsets.Offset

The values are physically stored as a 1-D ndarray of integers. These are
called "ordinals" and represent some kind of offset from a base.

The `freq` indicates the span covered by each element of the array.
All elements in the PeriodArray have the same `freq`.

Examples
--------
>>> pd.arrays.PeriodArray(pd.PeriodIndex(["2023-01-01", "2023-01-02"], freq="D"))
<PeriodArray>
['2023-01-01', '2023-01-02']
Length: 2, dtype: period[D]
iè  Úperiodarrayc                ó"   • [        U [        5      $ rG   )Ú
isinstancer,   )Úxs    rO   Ú<lambda>ÚPeriodArray.<lambda>»   s   € ÄØ	Œ;ôBrR   zCallable[[DtypeObj], bool]Ú_is_recognized_dtype)r   c                ó   • [         $ rG   )r#   ©rK   s    rO   Ú_scalar_typeÚPeriodArray._scalar_typeÀ   s   € äˆrR   z	list[str]Ú
_other_opsÚis_leap_yearÚ	_bool_ops)Ú
start_timeÚend_timeÚfreqÚ_object_ops)ÚyearÚmonthÚdayÚhourÚminuteÚsecondÚ
weekofyearÚweekdayÚweekÚ	dayofweekÚday_of_weekÚ	dayofyearÚday_of_yearÚquarterÚqyearÚdays_in_monthÚdaysinmonthÚ
_field_opsÚ_datetimelike_ops)ÚstrftimeÚto_timestampÚasfreqÚ_datetimelike_methodsr,   Ú_dtypeNFc                ó¸  • Ub/  [        U5      n[        U[        5      (       d  [        SU S35      e[        U[        5      (       a2  UR
                  n[        U[        U 5      5      (       d  [        S5      eO![        U[        5      (       a  UR
                  n[        U[        U 5      5      (       a>  Ub$  X!R                  :w  a  [        XR                  5      eUR                  UR                  p!U(       d  [        R                  " USS9nO[        R                  " USUS9nUc  [        S5      e[!        [        U5      n["        R$                  " XU5        g )NzInvalid dtype z for PeriodArrayzIncorrect dtypeÚint64©rH   ©rH   Úcopyz-dtype is not specified and cannot be inferred)r*   r\   r,   Ú
ValueErrorr/   Ú_valuesÚtypeÚ	TypeErrorr.   rH   Úraise_on_incompatiblerj   Ú_ndarrayÚnpÚasarrayÚarrayr
   r   Ú__init__)rK   ÚvaluesrH   rˆ   s       rO   r’   ÚPeriodArray.__init__ã   s  € ØÑÜ  Ó'ˆEÜ˜e¤[×1Ñ1Ü  >°%°Ð8HÐ!IÓJÐJä�fœi×(Ñ(Ø—^‘^ˆFÜ˜f¤d¨4£j×1Ñ1ÜÐ 1Ó2Ð2ð 2ô ˜¤×/Ñ/Ø—^‘^ˆFä�fœd 4›j×)Ñ)ØÑ  U¯l©lÓ%:Ü+¨F·J±JÓ?Ð?Ø"ŸO™O¨V¯\©\�EæÜ—Z’Z ¨gÑ6‰Fä—X’X˜f¨G¸$Ñ?ˆFØ‰=ÜÐLÓMÐMÜ”[ %Ó(ˆÜ×Ò˜t¨UÕ3rR   c                ó~   • Sn[        U[        R                  5      (       a  UR                  S:X  d   U5       eU " XS9$ )Nz Should be numpy array of type i8Úi8r†   )r\   r�   ÚndarrayrH   )Úclsr“   rH   Úassertion_msgs       rO   Ú_simple_newÚPeriodArray._simple_new   s;   € ð ;ˆÜ˜&¤"§*¡*×-Ñ-°&·,±,À$Ó2FÐUÈÓUÐFÙ�6Ñ'Ð'rR   r‡   c               ó°  • Ub  [        U5      nU(       a"  [        U[        5      (       a  UR                  nOS n[        X5      (       a/  [	        UR
                  U5        U(       a  UR                  5       nU$ [        R                  " U[        S9nU=(       d    [        R                  " U5      n[        R                  " XT5      n[        U5      nU " XbS9$ )Nr†   )r*   r\   r,   rj   Úvalidate_dtype_freqrH   rˆ   r�   r�   ÚobjectÚ	libperiodÚextract_freqÚextract_ordinals)r˜   ÚscalarsrH   rˆ   rj   ÚperiodsÚordinalss          rO   Ú_from_sequenceÚPeriodArray._from_sequence  s§   € ð ÑÜ  Ó'ˆEÞ”Z ¤{×3Ñ3Ø—:‘:‰DàˆDä�g×#Ñ#Ü §¡¨tÔ4ÞØ!Ÿ,™,›.�ØˆNä—*’*˜W¬FÑ3ˆà×6”y×-Ò-¨gÓ6ˆÜ×-Ò-¨gÓ<ˆÜ˜DÓ!ˆÙ�8Ñ)Ð)rR   ©rˆ   c               ó"   • U R                  XUS9$ )Nr‡   )r¥   )r˜   ÚstringsrH   rˆ   s       rO   Ú_from_sequence_of_stringsÚ%PeriodArray._from_sequence_of_strings'  s   € ð ×!Ñ! '¸TÐ!ÐBÐBrR   c                ó”   • [        U[        5      (       a  [        U5      R                  n[	        XU5      u  p[        U5      nU " XS9$ )zÇ
Construct a PeriodArray from a datetime64 array

Parameters
----------
data : ndarray[datetime64[ns], datetime64[ns, tz]]
freq : str or Tick
tz : tzinfo, optional

Returns
-------
PeriodArray[freq]
r†   )r\   r   r,   Ú_freqstrr   )r˜   Údatarj   ÚtzrH   s        rO   Ú_from_datetime64ÚPeriodArray._from_datetime64-  sD   € ô �dœJ×'Ñ'Ü˜tÓ$×-Ñ-ˆDÜ)¨$°bÓ9‰
ˆÜ˜DÓ!ˆÙ�4Ñ%Ð%rR   c                ó¤   • [         R                  " U5      nUb  [        R                  " U5      nUc  Ub  [	        XX45      u  pTXT4$ [        S5      e)Nz/Not enough parameters to construct Period range)ÚdtlÚvalidate_periodsr#   Ú_maybe_convert_freqÚ_get_ordinal_ranger‰   )r˜   ÚstartÚendr£   rj   Úsubarrs         rO   Ú_generate_rangeÚPeriodArray._generate_rangeB  sX   € ä×&Ò& wÓ/ˆàÑÜ×-Ò-¨dÓ3ˆDàÑ ¡Ü-¨e¸'ÓH‰LˆFð ˆ|Ðô ÐNÓOÐOrR   c               óT   • [        SSU0UD6u  p2[        U5      nU R                  X4S9$ )Nrj   r†   © )Ú_range_from_fieldsr,   rš   )r˜   Úfieldsrj   r¹   rH   s        rO   Ú_from_fieldsÚPeriodArray._from_fieldsP  s1   € ä)Ñ>¨tÐ>°vÑ>‰ˆÜ˜DÓ!ˆØ�‰˜vˆÐ3Ð3rR   c                ó  • U[         L a   [        R                  " UR                  5      $ [	        XR
                  5      (       a1  U R                  U5        [        R                  " UR                  5      $ [        SU S35      e)Nz!'value' should be a Period. Got 'z
' instead.)	r   r�   r…   Ú_valuer\   rc   Ú_check_compatible_withÚordinalr‰   ©rK   Úvalues     rO   Ú_unbox_scalarÚPeriodArray._unbox_scalar\  se   € ð ”CŠ<ä—8’8˜EŸL™LÓ)Ð)Ü˜×0Ñ0×1Ñ1Ø×'Ñ'¨Ô.Ü—8’8˜EŸM™MÓ*Ð*äÐ@ÀÀÀzÐRÓSÐSrR   c                ó(   • [        XR                  S9$ )N)rj   )r#   rj   rÆ   s     rO   Ú_scalar_from_stringÚPeriodArray._scalar_from_stringi  s   € Ü�e§)¡)Ñ,Ð,rR   c                óN   • U[         L a  g U R                  UR                  5        g rG   )r   Ú_require_matching_freqrj   ©rK   Úothers     rO   rÄ   Ú"PeriodArray._check_compatible_witho  s    € Ø”CŠ<Øð 	×#Ñ# E§J¡JÕ/rR   c                ó   • U R                   $ rG   )rƒ   rb   s    rO   rH   ÚPeriodArray.dtypey  s   € à�{‰{ÐrR   c                ó.   • U R                   R                  $ )z3
Return the frequency object for this PeriodArray.
©rH   rj   rb   s    rO   rj   ÚPeriodArray.freq~  s   € ð
 �z‰z�‰ÐrR   c                ó@   • [        U R                  5      R                  $ rG   )r,   rj   r­   rb   s    rO   ÚfreqstrÚPeriodArray.freqstr…  s   € ä˜4Ÿ9™9Ó%×.Ñ.Ð.rR   c                ó’  • US:X  ay  U(       dS  [         R                  " U R                  US9nU R                  (       a!  UR	                  5       nSUR
                  l        U$ [         R                  " U R                  US9$ USL a  [        S5      eU[        :X  a  U R                  ) $ [         R                  " [        U 5      [        S9$ )Nr–   r†   Fz:Unable to avoid copy while creating an array as requested.)r�   r�   rJ   Ú	_readonlyÚviewÚflagsÚ	writeabler‘   r‰   ÚboolÚ_isnanÚlistrž   )rK   rH   rˆ   rM   s       rO   Ú	__array__ÚPeriodArray.__array__‰  sŸ   € ð �D‹=ö ÜŸš D§I¡I°UÑ;�Ø—>—>Ø#Ÿ[™[›]�FØ-2�F—L‘LÔ*Ø�ä—x’x §	¡	°Ñ7Ð7à�5Š=ÜØLóð ð ”D‹=Ø—K‘K�<Ðô �xŠxœ˜T›
¬&Ñ1Ð1rR   c                ó  • SSK nSSKJn  Ub©  UR                  R	                  U5      (       a)  UR                  U R                  U R                  5       US9$ [        X5      (       aA  U R                  UR                  :w  a&  [        SU R                   SUR                   S35      eO[        SU S	35      eU" U R                  5      nUR                  U R                  U R                  5       S
S9nUR                  R                  XE5      $ )z&
Convert myself into a pyarrow Array.
r   N)ÚArrowPeriodType)Úmaskr‹   zENot supported to convert PeriodArray to array with different 'freq' (z vs Ú)z)Not supported to convert PeriodArray to 'z' typer…   )ÚpyarrowÚ(pandas.core.arrays.arrow.extension_typesrå   ÚtypesÚ
is_integerr‘   rŽ   r1   r\   rØ   rj   rŒ   r@   Úfrom_storage)rK   r‹   rè   rå   Úperiod_typeÚstorage_arrays         rO   Ú__arrow_array__ÚPeriodArray.__arrow_array__£  sñ   € ó 	åLàÑØ�}‰}×'Ñ'¨×-Ñ-Ø—}‘} T§]¡]¸¿¹»È4�}ÐPÐPÜ˜D×2Ñ2à—<‘< 4§9¡9Ó,Ü#ð#Ø#'§<¡< .°°T·Y±Y°K¸qðBóð ð -ô  Ø?À¸vÀVÐLóð ñ & d§l¡lÓ3ˆØŸ™ d§m¡m¸$¿)¹)»+ÈG˜ÐTˆØ×%Ñ%×2Ñ2°;ÓNÐNrR   rl   aN  
        The year of the period.

        See Also
        --------
        PeriodIndex.day_of_year : The ordinal day of the year.
        PeriodIndex.dayofyear : The ordinal day of the year.
        PeriodIndex.is_leap_year : Logical indicating if the date belongs to a
            leap year.
        PeriodIndex.weekofyear : The week ordinal of the year.
        PeriodIndex.year : The year of the period.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023", "2024", "2025"], freq="Y")
        >>> idx.year
        Index([2023, 2024, 2025], dtype='int64')
        rm   a�  
        The month as January=1, December=12.

        See Also
        --------
        PeriodIndex.days_in_month : The number of days in the month.
        PeriodIndex.daysinmonth : The number of days in the month.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
        >>> idx.month
        Index([1, 2, 3], dtype='int64')
        rn   aÞ  
        The days of the period.

        See Also
        --------
        PeriodIndex.day_of_week : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.day_of_year : The ordinal day of the year.
        PeriodIndex.dayofweek : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.dayofyear : The ordinal day of the year.
        PeriodIndex.days_in_month : The number of days in the month.
        PeriodIndex.daysinmonth : The number of days in the month.
        PeriodIndex.weekday : The day of the week with Monday=0, Sunday=6.

        Examples
        --------
        >>> idx = pd.PeriodIndex(['2020-01-31', '2020-02-28'], freq='D')
        >>> idx.day
        Index([31, 28], dtype='int64')
        ro   a®  
        The hour of the period.

        See Also
        --------
        PeriodIndex.minute : The minute of the period.
        PeriodIndex.second : The second of the period.
        PeriodIndex.to_timestamp : Cast to DatetimeArray/Index.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01-01 10:00", "2023-01-01 11:00"], freq='h')
        >>> idx.hour
        Index([10, 11], dtype='int64')
        rp   aØ  
        The minute of the period.

        See Also
        --------
        PeriodIndex.hour : The hour of the period.
        PeriodIndex.second : The second of the period.
        PeriodIndex.to_timestamp : Cast to DatetimeArray/Index.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01-01 10:30:00",
        ...                       "2023-01-01 11:50:00"], freq='min')
        >>> idx.minute
        Index([30, 50], dtype='int64')
        rq   aÖ  
        The second of the period.

        See Also
        --------
        PeriodIndex.hour : The hour of the period.
        PeriodIndex.minute : The minute of the period.
        PeriodIndex.to_timestamp : Cast to DatetimeArray/Index.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01-01 10:00:30",
        ...                       "2023-01-01 10:00:31"], freq='s')
        >>> idx.second
        Index([30, 31], dtype='int64')
        rt   av  
        The week ordinal of the year.

        See Also
        --------
        PeriodIndex.day_of_week : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.dayofweek : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.week : The week ordinal of the year.
        PeriodIndex.weekday : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.year : The year of the period.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
        >>> idx.week  # It can be written `weekofyear`
        Index([5, 9, 13], dtype='int64')
        rv   a(  
        The day of the week with Monday=0, Sunday=6.

        See Also
        --------
        PeriodIndex.day : The days of the period.
        PeriodIndex.day_of_week : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.day_of_year : The ordinal day of the year.
        PeriodIndex.dayofweek : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.dayofyear : The ordinal day of the year.
        PeriodIndex.week : The week ordinal of the year.
        PeriodIndex.weekday : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.weekofyear : The week ordinal of the year.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01-01", "2023-01-02", "2023-01-03"], freq="D")
        >>> idx.weekday
        Index([6, 0, 1], dtype='int64')
        rx   aú  
        The ordinal day of the year.

        See Also
        --------
        PeriodIndex.day : The days of the period.
        PeriodIndex.day_of_week : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.day_of_year : The ordinal day of the year.
        PeriodIndex.dayofweek : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.dayofyear : The ordinal day of the year.
        PeriodIndex.weekday : The day of the week with Monday=0, Sunday=6.
        PeriodIndex.weekofyear : The week ordinal of the year.
        PeriodIndex.year : The year of the period.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01-10", "2023-02-01", "2023-03-01"], freq="D")
        >>> idx.dayofyear
        Index([10, 32, 60], dtype='int64')

        >>> idx = pd.PeriodIndex(["2023", "2024", "2025"], freq="Y")
        >>> idx
        PeriodIndex(['2023', '2024', '2025'], dtype='period[Y-DEC]')
        >>> idx.dayofyear
        Index([365, 366, 365], dtype='int64')
        ry   ah  
        The quarter of the date.

        See Also
        --------
        PeriodIndex.qyear : Fiscal year the Period lies in according to its
            starting-quarter.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
        >>> idx.quarter
        Index([1, 1, 1], dtype='int64')
        rz   a�  
        Fiscal year the Period lies in according to its starting-quarter.

        The `year` and the `qyear` of the period will be the same if the fiscal
        and calendar years are the same. When they are not, the fiscal year
        can be different from the calendar year of the period.

        Returns
        -------
        int
            The fiscal year of the period.

        See Also
        --------
        PeriodIndex.quarter : The quarter of the date.
        PeriodIndex.year : The year of the period.

        Examples
        --------
        If the natural and fiscal year are the same, `qyear` and `year` will
        be the same.

        >>> per = pd.Period('2018Q1', freq='Q')
        >>> per.qyear
        2018
        >>> per.year
        2018

        If the fiscal year starts in April (`Q-MAR`), the first quarter of
        2018 will start in April 2017. `year` will then be 2017, but `qyear`
        will be the fiscal year, 2018.

        >>> per = pd.Period('2018Q1', freq='Q-MAR')
        >>> per.start_time
        Timestamp('2017-04-01 00:00:00')
        >>> per.qyear
        2018
        >>> per.year
        2017
        r{   a¢  
        The number of days in the month.

        See Also
        --------
        PeriodIndex.day : The days of the period.
        PeriodIndex.days_in_month : The number of days in the month.
        PeriodIndex.daysinmonth : The number of days in the month.
        PeriodIndex.month : The month as January=1, December=12.

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

        >>> period = pd.period_range('2020-1-1 00:00', '2020-3-1 00:00', freq='M')
        >>> s = pd.Series(period)
        >>> s
        0   2020-01
        1   2020-02
        2   2020-03
        dtype: period[M]
        >>> s.dt.days_in_month
        0    31
        1    29
        2    31
        dtype: int64

        For PeriodIndex:

        >>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
        >>> idx.days_in_month   # It can be also entered as `daysinmonth`
        Index([31, 28, 31], dtype='int64')
        c                óT   • [        [        R                  " U R                  5      5      $ )aR  
Logical indicating if the date belongs to a leap year.

See Also
--------
PeriodIndex.qyear : Fiscal year the Period lies in according to its
    starting-quarter.
PeriodIndex.year : The year of the period.

Examples
--------
>>> idx = pd.PeriodIndex(["2023", "2024", "2025"], freq="Y")
>>> idx.is_leap_year
array([False,  True, False])
)r   r�   r�   rl   rb   s    rO   rf   ÚPeriodArray.is_leap_yearã  s   € ô" œbŸjšj¨¯©Ó3Ó4Ð4rR   c                ó  • SSK Jn  [        R                  " U5      nU R                  R
                  S:X  d  US:X  a  SnOSnUS:H  nU(       ae  US:X  d  U R                  S:X  a'  [        SSS	9[        SUS	9-
  nU R                  S
S9U-   $ [        SUS	9nX R                  -   R                  S
S9U-
  $ Uc5  U R                  R                  5       n[        US5      nUR                  nUn	O"[        R                  " U5      nUR                  n	U R                  XS9n
[        R                   " U
R"                  U	5      nUR$                  " X»R&                  S9nUR(                  U:X  d   eU R                  R*                  S:X  aƒ  [,        R.                  " U R"                  5      n[1        U5      S:X  aR  US   nXàR&                  R2                  :X  a  U R                  Ul        U$ US:X  a  U R                  R
                  Ul        U$ UR7                  S5      nUbo  [9        U5      n[;        UR                  [<        5      (       aE  [;        U[<        5      (       d0  [        U5      [        UR                  R>                  S9:X  a  Xl        U$ )ap  
Cast to DatetimeArray/Index.

If possible, gives microsecond-unit DatetimeArray/Index. Otherwise
gives nanosecond unit.

Parameters
----------
freq : str or DateOffset, optional
    Target frequency. The default is 'D' for week or longer,
    's' otherwise.
how : {'s', 'e', 'start', 'end'}
    Whether to use the start or end of the time period being converted.

Returns
-------
DatetimeArray/Index
    Timestamp representation of given Period-like object.

See Also
--------
PeriodIndex.day : The days of the period.
PeriodIndex.from_fields : Construct a PeriodIndex from fields
    (year, month, day, etc.).
PeriodIndex.from_ordinals : Construct a PeriodIndex from ordinals.
PeriodIndex.hour : The hour of the period.
PeriodIndex.minute : The minute of the period.
PeriodIndex.month : The month as January=1, December=12.
PeriodIndex.second : The second of the period.
PeriodIndex.year : The year of the period.

Examples
--------
>>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
>>> idx.to_timestamp()
DatetimeIndex(['2023-01-01', '2023-02-01', '2023-03-01'],
dtype='datetime64[us]', freq='MS')

The frequency will not be inferred if the index contains less than
three elements, or if the values of index are not strictly monotonic:

>>> idx = pd.PeriodIndex(["2023-01", "2023-02"], freq="M")
>>> idx.to_timestamp()
DatetimeIndex(['2023-01-01', '2023-02-01'], dtype='datetime64[us]', freq=None)

>>> idx = pd.PeriodIndex(
...     ["2023-01", "2023-02", "2023-02", "2023-03"], freq="2M"
... )
>>> idx.to_timestamp()
DatetimeIndex(['2023-01-01', '2023-02-01', '2023-02-01', '2023-03-01'],
dtype='datetime64[us]', freq=None)
r   )r>   ÚnsÚusÚEÚBé   ÚD)Úunitr·   )Úhowr†   Úinfer©Údays) Úpandas.core.arraysr>   rŸ   Úvalidate_end_aliasrj   rL   r   r€   rƒ   Ú_get_to_timestamp_baser   r­   r#   rµ   Ú_period_dtype_coder�   Úperiodarr_to_dt64arrrJ   r¥   rH   rú   rN   ÚlibalgosÚunique_deltasÚlenÚ_nÚ_freqÚ
_with_freqr   r\   r   Ún)rK   rj   rû   r>   rú   r¸   ÚadjustÚ	freq_coderH   rL   Únew_parrÚnew_dataÚdtaÚdiffsÚdiffs                  rO   r€   ÚPeriodArray.to_timestampö  s   € õj 	5ä×*Ò*¨3Ó/ˆà�9‰9�>‰>˜TÓ! T¨T£\Ø‰DàˆDà�S‰jˆÞØ�s‹{˜dŸi™i¨3Ó.ä" 1¨3Ñ/´)¸AÀDÑ2IÑI�Ø×(Ñ(¨WÐ(Ð5¸Ñ>Ð>ä" 1¨4Ñ0�ØŸy™yÑ(×6Ñ6¸7Ð6ÐCÀfÑLÐLà‰<ØŸ™×:Ñ:Ó<ˆIÜ# I¨qÓ1ˆEØ—>‘>ˆDØ‰Dä×-Ò-¨dÓ3ˆDØ×*Ñ*ˆDà—;‘;˜t�;Ð-ˆä×1Ò1°(·-±-ÀÓFˆØ×*Ò*¨8¿>¹>ÑJˆØ�x‰x˜4ÓÐÐà�9‰9�>‰>˜SÓ ô ×*Ò*¨4¯9©9Ó5ˆEÜ�5‹z˜Q‹Ø˜Q‘x�ØŸ:™:Ÿ=™=Ó(Ø $§	¡	�C”Ið ˆJð ˜Q“YØ $§	¡	§¡�C”IàˆJà—.‘. Ó)ˆCØÑÜ  “�ä˜sŸx™x¬×-Ñ-Ü& t¬S×1Ñ1Ü! $›¬9¸#¿(¹(¿*¹*Ñ+EÓEà $”IØˆJrR   c                ó>   • [         R                  " XR                  S9$ )N)rÅ   rj   )r#   Ú_from_ordinalrj   )rK   r]   s     rO   Ú	_box_funcÚPeriodArray._box_funcg  s   € Ü×#Ò#¨A·I±IÑ>Ð>rR   ÚPeriodIndex)rÐ   Ú
other_namec                ó  • [         R                  " U5      n[        U[        5      (       a&  [	        US5      (       a  [        U5      R                  n[        R                  " U5      nU R                  R                  nUR                  nU R                  nUS:H  nU(       a  XPR                  R                  -   S-
  nOUn[        XsXF5      nU R                   (       a  ["        X€R$                  '   [        U5      n	['        U 5      " X‰S9$ )a¢  
Convert the {klass} to the specified frequency `freq`.

Equivalent to applying :meth:`pandas.Period.asfreq` with the given arguments
to each :class:`~pandas.Period` in this {klass}.

Parameters
----------
freq : str
    A frequency.
how : str {{'E', 'S'}}, default 'E'
    Whether the elements should be aligned to the end
    or start within pa period.

    * 'E', 'END', or 'FINISH' for end,
    * 'S', 'START', or 'BEGIN' for start.

    January 31st ('END') vs. January 1st ('START') for example.

Returns
-------
{klass}
    The transformed {klass} with the new frequency.

See Also
--------
{other}.asfreq: Convert each Period in a {other_name} to the given frequency.
Period.asfreq : Convert a :class:`~pandas.Period` object to the given frequency.

Examples
--------
>>> pidx = pd.period_range("2010-01-01", "2015-01-01", freq="Y")
>>> pidx
PeriodIndex(['2010', '2011', '2012', '2013', '2014', '2015'],
dtype='period[Y-DEC]')

>>> pidx.asfreq("M")
PeriodIndex(['2010-12', '2011-12', '2012-12', '2013-12', '2014-12',
'2015-12'], dtype='period[M]')

>>> pidx.asfreq("M", how="S")
PeriodIndex(['2010-01', '2011-01', '2012-01', '2013-01', '2014-01',
'2015-01'], dtype='period[M]')
r  rö   rø   r†   )rŸ   r   r\   r   Úhasattrr,   r­   r#   rµ   rƒ   rI   r  rJ   rH   r  r%   Ú_hasnar   rà   r‹   )
rK   rj   rû   Úbase1Úbase2rJ   r¸   rÅ   r  rH   s
             rO   r�   ÚPeriodArray.asfreqj  sÐ   € ô\ ×*Ò*¨3Ó/ˆÜ�dœJ×'Ñ'¬G°DÐ:N×,OÑ,OÜ˜tÓ$×-Ñ-ˆDÜ×)Ò)¨$Ó/ˆà—‘×'Ñ'ˆØ×'Ñ'ˆà�y‰yˆà�S‰jˆÞØŸZ™ZŸ]™]Ñ*¨QÑ.‰GàˆGä$ W°UÓ@ˆà�;�;Ü$(ˆH—[‘[Ñ!ä˜DÓ!ˆÜ�DŒz˜(Ñ0Ð0rR   c                ó4   • U(       a  [         $ SR                  $ )Nz'{}')ÚstrÚformat)rK   Úboxeds     rO   Ú
_formatterÚPeriodArray._formatter³  s   € ÞÜˆJØ�}‰}ÐrR   r   )Úna_repÚdate_formatc               ón   • [         R                  " U R                  U R                  R                  X5      $ )z#
actually format my specific types
)rŸ   Úperiod_array_strftimerJ   rH   rI   )rK   r%  r&  Úkwargss       rO   Ú_format_native_typesÚ PeriodArray._format_native_types¸  s,   € ô ×.Ò.Ø�I‰I�t—z‘z×-Ñ-¨vó
ð 	
rR   Tc                óè  >• [        U5      nXR                  :X  a  U(       d  U $ U R                  5       $ [        U[        5      (       a  U R                  UR                  5      $ [        R                  " US5      (       d  [        U[        5      (       aQ  [        USS 5      n[        R                  " U5      nU R                  5       R                  U5      R                  U5      $ [         TU ]E  XS9$ )NÚMr¯   r§   )r*   rƒ   rˆ   r\   r,   r�   rj   r   Úis_np_dtyper+   Úgetattrr³   Údtype_to_unitr€   Útz_localizeÚas_unitÚsuperÚastype)rK   rH   rˆ   r¯   rú   Ú	__class__s        €rO   r4  ÚPeriodArray.astypeÄ  sÀ   ø€ ô ˜UÓ#ˆØ—K‘KÓÞØ�à—y‘y“{Ð"Ü�eœ[×)Ñ)Ø—;‘;˜uŸz™zÓ*Ð*ä�?Š?˜5 #×&Ñ&¬*°U¼O×*LÑ*Lä˜  dÓ+ˆBÜ×$Ò$ UÓ+ˆDð ×$Ñ$Ó&×2Ñ2°2Ó6×>Ñ>¸tÓDÐDä‰w‰~˜eˆ~Ð/Ð/rR   c                ó˜   • U R                  U5      R                  S5      nU R                  R                  S5      nUR                  XBUS9$ )NúM8[ns])ÚsideÚsorter)Ú_validate_setitem_valuerÜ   rŽ   Úsearchsorted)rK   rÇ   r9  r:  ÚnpvalueÚm8arrs         rO   r<  ÚPeriodArray.searchsortedÚ  sK   € ð ×.Ñ.¨uÓ5×:Ñ:¸8ÓDˆð —‘×"Ñ" 8Ó,ˆØ×!Ñ! '¸VÐ!ÐDÐDrR   )ÚlimitÚ
limit_arearˆ   c               ó    • U R                  S5      nUR                  XX4S9nU(       a%  [        SUR                  U R                  5      5      $ U $ )Nr8  )Úmethodr@  rA  rˆ   r   )rÜ   Ú_pad_or_backfillr
   rH   )rK   rC  r@  rA  rˆ   r  rM   s          rO   rD  ÚPeriodArray._pad_or_backfillç  sP   € ð �i‰i˜Ó!ˆØ×%Ñ%Ø°:ð &ð 
ˆö Ü˜ §¡¨D¯J©JÓ 7Ó8Ð8àˆKrR   c                óþ   • U[         R                  [         R                  4;   d   eU[         R                  L a  U* n[        U R                  [
        R                  " USS95      n[        U 5      " X0R                  S9$ )z¤
Add or subtract array of integers.

Parameters
----------
other : np.ndarray[int64] or int
op : {operator.add, operator.sub}

Returns
-------
result : PeriodArray
r–   r†   )	ÚoperatorÚaddÚsubr   rJ   r�   r�   r‹   rH   )rK   rÐ   ÚopÚ
res_valuess       rO   Ú_addsub_int_array_or_scalarÚ'PeriodArray._addsub_int_array_or_scalarý  s`   € ð ”h—l‘l¤H§L¡LÐ1Ó1Ð1Ð1Ø”—‘ÒØ�FˆEÜ% d§i¡i´·²¸EÈÑ1NÓOˆ
Ü�DŒz˜*¯J©JÑ7Ð7rR   c                ó  • [        U[        5      (       a   e[        U[        5      (       a$  U [        R                  " UR
                  S5      -   $ U R                  USS9  U R                  UR
                  [        R                  5      $ )Nrù   T)rL   )
r\   r   r   r�   Útimedelta64r
  rÎ   rL  rG  rH  rÏ   s     rO   Ú_add_offsetÚPeriodArray._add_offset  sj   € Ü˜e¤T×*Ñ*Ð*Ð*ä�eœS×!Ñ!Øœ"Ÿ.š.¨¯©°#Ó6Ñ6Ð6à×#Ñ# E°Ð#Ñ5Ø×/Ñ/°·±¼¿¹ÓFÐFrR   c                ó¤  >• [        U R                  [        [        45      (       d  [	        X5      e[        U5      (       a  [        TU ]  U5      $ [        U[        5      (       a2  [        R                  " [        UR                  S9R                  5      nO)[        R                  " [        U5      R                  5      nU R                  U5      $ )z\
Parameters
----------
other : timedelta, Tick, np.timedelta64

Returns
-------
PeriodArray
rý   )r\   rj   r   r   r�   r1   r3  Ú_add_timedeltalike_scalarr�   r�   r   r
  Úasm8Ú_add_timedelta_arraylike)rK   rÐ   Útdr5  s      €rO   rS  Ú%PeriodArray._add_timedeltalike_scalar  s’   ø€ ô ˜$Ÿ)™)¤d¬C [×1Ñ1ä'¨Ó4Ð4ä��;‰;ä‘7Ñ4°UÓ;Ð;ä�eœS×!Ñ!Ü—’œI¨5¯7©7Ñ3×8Ñ8Ó9‰Bä—’œI eÓ,×1Ñ1Ó2ˆBØ×,Ñ,¨RÓ0Ð0rR   c                óî  • U R                   R                  5       (       d  [        SU R                    35      e[        R                   " SU R                   R                   S35      n [        [        R                  " U5      USSS9n[        U R                  [        R                  " UR                  S5      5      5      n[        U 5      " XPR                   S	9$ ! [         a  n[        S5      UeSnAff = f)
zc
Parameters
----------
other : TimedeltaArray or ndarray[timedelta64]

Returns
-------
PeriodArray
z2Cannot add or subtract timedelta64[ns] dtype from úm8[Ú]F©rH   rˆ   Úround_okznCannot add/subtract timedelta-like from PeriodArray that is not an integer multiple of the PeriodArray's freq.Nr–   r†   )rH   Ú_is_tick_likerŒ   r�   Ú
_td64_unitr   r�   r‰   r"   r   rJ   rÜ   r‹   )rK   rÐ   rH   ÚdeltaÚerrrK  s         rO   rU  Ú$PeriodArray._add_timedelta_arraylike4  sÚ   € ð �z‰z×'Ñ'×)Ñ)äØDÀTÇZÁZÀLÐQóð ô —’˜3˜tŸz™z×4Ñ4Ð5°QÐ7Ó8ˆð
	Ü'Ü—
’
˜5Ó!¨°UÀUñˆEô & d§i¡i´·²¸E¿J¹JÀtÓ<LÓ1MÓNˆ
Ü�DŒz˜*¯J©JÑ7Ð7øô ó 	ô (ðEóð ðûð	ús   Á' C Ã
C4Ã#C/Ã/C4c                ó  • U R                   R                  5       (       d   e[        R                   " SU R                   R                   S35      n[	        U[
        [        R                  [        45      (       a*  [        R                  " [        U5      R                  5      nO[        R                  " U5      n [        X2SSS9nUR                  S5      n[        R                   " U5      $ ! [         a  n[        X5      UeSnAff = f)aÄ  
Arithmetic operations with timedelta-like scalars or array `other`
are only valid if `other` is an integer multiple of `self.freq`.
If the operation is valid, find that integer multiple.  Otherwise,
raise because the operation is invalid.

Parameters
----------
other : timedelta, np.timedelta64, Tick,
        ndarray[timedelta64], TimedeltaArray, TimedeltaIndex

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

Raises
------
IncompatibleFrequency
rY  rZ  Fr[  Nr–   )rH   r]  r�   r^  r\   r   rO  r   r�   r   rT  r   r‰   r�   rÜ   r   Úitem_from_zerodim)rK   rÐ   rH   rV  r_  r`  s         rO   Ú _check_timedeltalike_freq_compatÚ,PeriodArray._check_timedeltalike_freq_compatY  sÑ   € ð( �z‰z×'Ñ'×)Ñ)Ð)Ð)ä—’˜3˜tŸz™z×4Ñ4Ð5°QÐ7Ó8ˆä�eœi¬¯©¼Ð>×?Ñ?Ü—’œI eÓ,×1Ñ1Ó2‰Bä—’˜EÓ"ˆBð	>Ü'¨¸eÈeÑTˆEð —
‘
˜4Ó ˆÜ×$Ò$ UÓ+Ð+øô	 ó 	>Ü'¨Ó4¸#Ð=ûð	>ús   Â;C- Ã-
DÃ7DÄD©ÚskipnaÚkeepdimsc               ó¬   >• [         TU ]  " U4X#S.UD6nU(       a8  [        U[        R                  5      (       a  U R                  XPR                  S9$ U$ )Nrf  r†   )r3  Ú_reducer\   r�   r—   r¥   rH   )rK   rN   rg  rh  r)  rM   r5  s         €rO   rj  ÚPeriodArray._reduce�  sM   ø€ ô ‘’ ÐR¨fÑRÈ6ÑRˆÞœ
 6¬2¯:©:×6Ñ6Ø×&Ñ& v·Z±ZÐ&Ð@Ð@ØˆrR   r½   )Úreturnztype[Period]©NF)rH   úDtype | Nonerˆ   rß   rl  ÚNone)r“   znpt.NDArray[np.int64]rH   r,   rl  r   )rH   rn  rˆ   rß   rl  r   )rH   r=   rˆ   rß   rl  r   rG   )rl  r   )r¿   Údictrl  r   )rÇ   úPeriod | NaTTyperl  znp.int64)rÇ   r   rl  r#   )rÐ   zPeriod | NaTType | PeriodArrayrl  ro  )rl  r,   )rl  r   )rl  r   )NN)rH   zNpDtype | Nonerˆ   zbool | Nonerl  z
np.ndarray)rl  znpt.NDArray[np.bool_])Nr·   )rû   r   rl  r>   )rl  rq  )Nrö   )rû   r   rl  r   )F)r"  rß   rl  zCallable[[object], str])r%  zstr | floatrl  znpt.NDArray[np.object_])T)rˆ   rß   )ÚleftN)rÇ   z$NumpyValueArrayLike | ExtensionArrayr9  zLiteral['left', 'right']r:  zNumpySorter | Nonerl  znpt.NDArray[np.intp] | np.intp)
rC  r8   r@  z
int | NonerA  z#Literal['inside', 'outside'] | Nonerˆ   rß   rl  r   )rÐ   znp.ndarray | intrJ  zCallable[[Any, Any], Any]rl  r   )rÐ   r   )rÐ   z,TimedeltaArray | npt.NDArray[np.timedelta64]rl  r   )rN   r   rg  rß   rh  rß   )NrS   Ú
__module__Ú__qualname__Ú__firstlineno__rT   Ú__array_priority__Ú_typr�   r…   r   Ú_internal_fill_valuer#   Ú_recognized_scalarsr`   Ú__annotations__Ú_infer_matchesrU   rc   re   rg   rk   r}   r~   r‚   r’   Úclassmethodrš   r¥   rª   r°   rº   rÀ   rÈ   rË   rÄ   r&   rH   rj   rØ   râ   rï   rW   rl   rm   rn   ro   rp   rq   rr   rt   rv   ru   rs   rw   rx   ry   rz   r{   r|   rf   r€   r  r'   Ú_shared_doc_kwargsr�   r#  r*  r4  r<  rD  rL  rP  rS  rU  rd  rj  Ú__static_attributes__Ú__classcell__)r5  s   @rO   rD   rD   |   s~  ø‡ ñ4ðn ÐØ€DØŸ8š8 D›>ÐØ!˜)Ðñ8ÐÐ4ó ð !€Nàóó ðð €J�	ÓØ*Ð+€IˆyÓ+Ú?€K�Ó?ò€J�	ó ð& $.°Ñ#;¸iÑ#GÐ�yÓGÚ'MÐ˜9ÓMàÓö
4ð: ð(à%ð(ð ð(ð 
ó	(ó ð(ð ð
 #Øñ*ð ð	*ð
 ð*ð 
ô*ó ð*ð6 à=BñCØ .ðCØ6:ðCà	ôCó ðCð
 õ&ó ð&ð( ñó ðð ó4ó ð4ðTàðTð 
ôTô-ô0ð óó ðð óó ðð ó/ó ð/ð AEð2Ø#ð2Ø2=ð2à	õ2ô4Oñ< Øð	ó€Dñ* Øð	ó€Eñ" Øð	ó€Cñ, Øð	ó€Dñ$ Øð	ó€Fñ& Øð	ó€Fñ& !Øð	ó€Jð( €DÙ!Øð	ó€Kð. €IØ€GÙ-Øð	óð €I�ñ: Øð	ó€Gñ" Øð'	ó*€EñX $Øð 	ó#€MðH  €Kàó5ó ð5ö$môb?ñ 	ÑMÐÐM ]¸}ÓMõC1ó NðC1öPð (-¸$ñ
Ø$ð
à	 õ
÷0ñ 0ð2 *0Ø%)ð	Eà3ðEð 'ðEð #ð	Eð
 
(õEð" !Ø:>Øñð ðð ð	ð
 8ðð ðð 
õð,8Ø%ð8Ø+Dð8à	ô8ô*Gõ1ð0#8ØAð#8à	ô#8òJ#,ðR ,0À%ñØðØ$(ðØ;?÷ö rR   c                ó|  • [        U[        R                  [        45      (       d  Uc  SnO®[        U[        5      (       aN  [
        R                  " 5          [
        R                  " SS[        S9  [        U5      R                  nSSS5        OK[        U[        [        [        45      (       a  UR                  nO[        [!        U5      5      R                  n[        U R"                  5      R                  n[$        R&                  " [)        U 5      R*                  UWS9n[-        U5      $ ! , (       d  f       Na= f)a  
Helper function to render a consistent error message when raising
IncompatibleFrequency.

Parameters
----------
left : PeriodArray
right : None, DateOffset, Period, ndarray, or timedelta-like

Returns
-------
IncompatibleFrequency
    Exception to be raised by the caller.
NÚignorezPeriodDtype\[B\] is deprecated)Úcategory)r˜   Úown_freqÚ
other_freq)r\   r�   r—   r0   r   ÚwarningsÚcatch_warningsÚfilterwarningsÚFutureWarningr,   r­   r.   rD   r#   rØ   r    r   rj   r!   r!  r‹   rS   r"   )rr  Úrightr„  rƒ  Úmsgs        rO   r�   r�   Š  sì   € ô  �%œ"Ÿ*™*Ô&7Ð8×9Ñ9¸U¹]Ø‰
Ü	�Eœ:×	&Ñ	&Ü×$Ò$Õ&Ü×#Ò#ØÐ;Ämòô % UÓ+×4Ñ4ˆJ÷	 'Ð&ô
 
�EœN¬K¼Ð@×	AÑ	AØ—]‘]‰
ä"¤9¨UÓ#3Ó4×<Ñ<ˆ
ä˜4Ÿ9™9Ó%×.Ñ.€HÜ
×
Ò
Ü�‹J×Ñ¨(¸zñ€Cô ! Ó%Ð%÷ 'Õ&ús   Á0D-Ä-
D;c                óp  • [        U SS5      n[        R                  " US5      (       a  [        R	                  X5      $ [        U[        5      (       a2  [        U 5      nUb"  XR                  :X  a  U$ UR                  U5      $ U$ [        U [        R                  [        [        [        45      (       d  [        U 5      n [        R                  " U 5      nU(       a  [        U5      nOSnUR                  R                   S:X  a  [#        U5      S:”  a  [%        S5      eUR                  R                   S;   a=  UR'                  [        R(                  SS	9n[*        R,                  " Xq5      n[        X†S
9$ [/        U5      n Uc  [*        R0                  " U 5      n[        U5      n[        R3                  XS
9$ )aø  
Construct a new PeriodArray from a sequence of Period scalars.

Parameters
----------
data : Sequence of Period objects
    A sequence of Period objects. These are required to all have
    the same ``freq.`` Missing values can be indicated by ``None``
    or ``pandas.NaT``.
freq : str, Tick, or Offset
    The frequency of every element of the array. This can be specified
    to avoid inferring the `freq` from `data`.
copy : bool, default False
    Whether to ensure a copy of the data is made.

Returns
-------
PeriodArray

See Also
--------
PeriodArray
pandas.PeriodIndex

Examples
--------
>>> period_array([pd.Period("2017", freq="Y"), pd.Period("2018", freq="Y")])
<PeriodArray>
['2017', '2018']
Length: 2, dtype: period[Y-DEC]

>>> period_array([pd.Period("2017", freq="Y"), pd.Period("2018", freq="Y"), pd.NaT])
<PeriodArray>
['2017', '2018', 'NaT']
Length: 3, dtype: period[Y-DEC]

Integers that look like years are handled

>>> period_array([2000, 2001, 2002], freq="D")
<PeriodArray>
['2000-01-01', '2001-01-01', '2002-01-01']
Length: 3, dtype: period[D]

Datetime-like strings may also be passed

>>> period_array(["2000-Q1", "2000-Q2", "2000-Q3", "2000-Q4"], freq="Q")
<PeriodArray>
['2000Q1', '2000Q2', '2000Q3', '2000Q4']
Length: 4, dtype: period[Q-DEC]
rH   Nr-  rP   r   z9PeriodIndex does not allow floating point in constructionÚiuFr§   r†   )r/  r   r.  rD   r°   r\   r,   rj   r�   r�   r—   rá   Útupler/   r�   rH   Úkindr  rŒ   r4  r…   rŸ   Úfrom_ordinalsr)   r    r¥   )	r®   rj   rˆ   Ú
data_dtypeÚoutÚarrdatarH   Úarrr¤   s	            rO   Úperiod_arrayr”  ²  sg  € ôn ˜˜w¨Ó-€Jä
‡‚�z 3×'Ñ'Ü×+Ñ+¨DÓ7Ð7Ü�*œk×*Ñ*Ü˜$ÓˆØÑØ—‘Ó&Ø�
Ø—:‘:˜dÓ#Ð#Øˆ
ô �dœRŸZ™Z¬¬u´iÐ@×AÑAÜ�D‹zˆä�jŠj˜Ó€Gö Ü˜DÓ!‰àˆà‡}�}×Ñ˜SÓ ¤S¨£\°AÓ%5ÜÐSÓTÐTà‡}�}×Ñ˜TÓ!Ø�n‰nœRŸX™X¨EˆnÐ2ˆô ×*Ò*¨3Ó5ˆÜ˜8Ñ1Ð1ä˜Ó!€DØ�|Ü×%Ò% dÓ+ˆÜ˜Ó€EÜ×%Ñ% dÐ%Ð8Ð8rR   c                ó   • g rG   r½   rÕ   s     rO   r�   r�     s   € ØBErR   c                ó   • g rG   r½   rÕ   s     rO   r�   r�     s   € ØLOrR   c                óÒ   • Ub
  [        USS9nU bV  [        U 5      n [        U [        5      (       d  [	        S5      eUc  U R
                  nU$ XR
                  :w  a  [        S5      eU$ )a<  
If both a dtype and a freq are available, ensure they match.  If only
dtype is available, extract the implied freq.

Parameters
----------
dtype : dtype
freq : DateOffset or None

Returns
-------
freq : DateOffset

Raises
------
ValueError : non-period dtype
IncompatibleFrequency : mismatch between dtype and freq
T©Ú	is_periodzdtype must be PeriodDtypez&specified freq and dtype are different)r   r*   r\   r,   r‰   rj   r"   rÕ   s     rO   r�   r�     ss   € ð* ÑÜ˜¨Ñ.ˆàÑÜ˜UÓ#ˆÜ˜%¤×-Ñ-ÜÐ8Ó9Ð9Ø‰<Ø—:‘:ˆDð
 €Kð	 —Z‘ZÓÜ'Ð(PÓQÐQð €KrR   c                óz  • [        U R                  [        R                  5      (       a  U R                  R                  S:w  a  [	        SU R                   35      eUcd  [        U [
        5      (       a  U R                  U R                  pO^[        U [        5      (       a!  U R                  U R                  R                  pO'[        U [
        [        45      (       a  U R                  n [        U R                  5      n[        R                  " U5      nUR                  n[        U R                  S5      XBUS9U4$ )a±  
Convert a datetime-like array to values Period ordinals.

Parameters
----------
data : Union[Series[datetime64[ns]], DatetimeIndex, ndarray[datetime64ns]]
freq : Optional[Union[str, Tick]]
    Must match the `freq` on the `data` if `data` is a DatetimeIndex
    or Series.
tz : Optional[tzinfo]

Returns
-------
ordinals : ndarray[int64]
freq : Tick
    The frequency extracted from the Series or DatetimeIndex if that's
    used.

r-  zWrong dtype: r–   )Úreso)r\   rH   r�   rŽ  r‰   r-   rŠ   rj   r/   Údtr   r#   rµ   r  Úc_dt64arr_to_periodarrrÜ   )r®   rj   r¯   r›  rL   s        rO   r   r   ?  sà   € ô, �d—j‘j¤"§(¡(×+Ñ+¨t¯z©z¯©À#Ó/EÜ˜=¨¯©¨Ð5Ó6Ð6à�|Ü�dœH×%Ñ%ØŸ™ t§y¡y‘$Ü˜œi×(Ñ(ØŸ™ t§w¡w§|¡|�$øä	�Dœ8¤YÐ/×	0Ñ	0Ø�|‰|ˆä˜tŸz™zÓ*€DÜ×%Ò% dÓ+€DØ×"Ñ"€DÜ! $§)¡)¨D£/°4À$ÑGÈÐMÐMrR   c                ó¸  • [         R                  " XU5      S:w  a  [        S5      eUb  [        USS9nUR                  nU b  [        X5      n Ub  [        X5      n[        U [
        5      n[        U[
        5      nU(       a,  U(       a%  U R                  UR                  :w  a  [        S5      eU [        L d	  U[        L a  [        S5      eUc?  U(       a  U R                  nOU(       a  UR                  nO[        S5      eUR                  nUbŒ  X$-  nU cE  [        R                  " UR                  U-
  U-   UR                  S-   U[        R                  S	9nXs4$ [        R                  " U R                  U R                  U-   U[        R                  S	9n Xs4$ [        R                  " U R                  UR                  S-   U[        R                  S	9nXs4$ )
Né   zOOf the three parameters: start, end, and periods, exactly two must be specifiedTr˜  z!start and end must have same freqzstart and end must not be NaTz#Could not infer freq from start/endrø   r†   )ÚcomÚcount_not_noner‰   r   r
  r#   r\   rj   r   r�   ÚarangerÅ   r…   )r·   r¸   r£   rj   ÚmultÚis_start_perÚ
is_end_perr®   s           rO   r¶   r¶   g  s—  € Ü
×Ò˜% gÓ.°!Ó3Üð,ó
ð 	
ð
 ÑÜ˜¨Ñ.ˆØ�v‰vˆàÑÜ�uÓ#ˆØ
�Ü�SÓˆä˜e¤VÓ,€LÜ˜C¤Ó(€Jæž
 u§z¡z°S·X±XÓ'=ÜÐ<Ó=Ð=Ø”‚|�sœc’zÜÐ8Ó9Ð9à�|ÞØ—:‘:‰DÞØ—8‘8‰DäÐBÓCÐCØ�v‰vˆàÑØ‘.ˆØ‰=Ü—9’9Ø—‘˜gÑ%¨Ñ,¨c¯k©k¸A©o¸tÌ2Ï8É8ñˆDð ˆ:Ðô —9’9Ø—‘˜uŸ}™}¨wÑ6¸ÄBÇHÁHñ‰Dð ˆ:Ðô �yŠy˜Ÿ™¨¯©°a©¸ÄRÇXÁXÑNˆàˆ:ÐrR   c                óh  • Uc  SnUc  SnUc  SnUc  Sn/ nUGb  Uc3  [        SSS9n[        [        [        R                  R
                  5      n	OW[        USS9n[        R                  " U5      n	U	[        [        [        R                  R
                  5      :w  a  [        S5      eUR                  n
[        X5      u  p[        XSS9 HL  u  p¼[        R                  " X¼U
5      u  pÞ[        R                  " XÞSSSSSSU	5	      nUR                  U5        MN     Os[        USS9n[        R                  " U5      n	[        XX4XV5      n[        USS06 H7  u  nnnnnnUR                  [        R                  " UUUUUUSSU	5	      5        M9     [         R"                  " U[         R$                  S	9U4$ )
Nr   rø   ÚQTr˜  zbase must equal FR_QTR)Ústrictr¨  r†   )r   r
   Úintr   ÚFR_QTRrÇ   rŸ   Úfreq_to_dtype_codeÚAssertionErrorrØ   Ú_make_field_arraysÚzipr   Úquarter_to_myearÚperiod_ordinalÚappendr�   r‘   r…   )rl   rm   ry   rn   ro   rp   rq   rj   r¤   rL   rØ   ÚyÚqÚcalendar_yearÚcalendar_monthÚvalÚarraysÚmthÚdÚhÚmnÚss                         rO   r¾   r¾   ˜  s   € ð �|ØˆØ�~ØˆØ�~ØˆØ
�{Øˆà€HàÒØ‰<Ü˜S¨DÑ1ˆDÜœœY×-Ñ-×3Ñ3Ó4‰Dä˜T¨TÑ2ˆDÜ×/Ò/°Ó5ˆDØ”tœC¤×!1Ñ!1×!7Ñ!7Ó8Ó8Ü$Ð%=Ó>Ð>à—,‘,ˆÜ*¨4Ó9‰ˆÜ˜¨dÔ3‰DˆAÜ,3×,DÒ,DÀQÈ7Ó,SÑ)ˆMÜ×*Ò*Ø¨q°!°Q¸¸1¸aÀóˆCð �O‰O˜CÖ ò 4ô ˜¨Ñ.ˆÜ×+Ò+¨DÓ1ˆÜ# D°¸FÓKˆÜ#&¨Ð#<°tÔ#<ÑˆAˆs�A�q˜"˜aØ�O‰OœI×4Ò4°Q¸¸QÀÀ2ÀqÈ!ÈQÐPTÓUÖVñ $=ô �8Š8�H¤B§H¡HÑ-¨tÐ3Ð3rR   c            	     ó¢  • S nU  H\  n[        U[        [        R                  [        45      (       d  M/  Ub  [        U5      U:w  a  [        S5      eUb  MQ  [        U5      nM^     U  Vs/ s HY  n[        U[        R                  [        [        45      (       a  [        R                  " U5      O[        R                  " X!5      PM[     sn$ s  snf )NzMismatched Period array lengths)	r\   rá   r�   r—   r/   r  r‰   r�   Úrepeat)r¿   Úlengthr]   s      rO   r­  r­  É  s²   € Ø€FÛˆÜ�aœ$¤§
¡
¬IÐ6×7Ó7ØÑ!¤c¨!£f°Ó&6Ü Ð!BÓCÐCØ‹~Ü˜Q›’ñ ñ  óò ˆAô ˜!œbŸj™j¬$´	Ð:×;Ñ;ô �JŠJ�qŒMä—’˜1Ó%ò&ñ ñð ùò s   Á)A CrG   )rN   r   rV   z
str | None)rl  r"   rm  )r®   z,Sequence[Period | str | None] | AnyArrayLikerj   zstr | Tick | BaseOffset | Nonerˆ   rß   rl  rD   )rj   rA   rl  rA   )rj   ztimedelta | str | Nonerl  r   )rj   z1BaseOffsetT | BaseOffset | timedelta | str | Nonerl  rA   )rl  z(tuple[npt.NDArray[np.int64], BaseOffset])rø   )r£  r©  )NNNNNNNN)rl  ztuple[np.ndarray, BaseOffset])rl  zlist[np.ndarray])iÚ
__future__r   Údatetimer   rG  Útypingr   r   r   r   r	   r
   r   r…  Únumpyr�   Úpandas._libsr   r  r   Úpandas._libs.arraysr   Úpandas._libs.tslibsr   r   r   r   r   r   r   r   r�  r   r   r   r   rŸ   r   Úpandas._libs.tslibs.dtypesr   r   Úpandas._libs.tslibs.fieldsr   Úpandas._libs.tslibs.offsetsr   r    Úpandas._libs.tslibs.periodr!   r"   r#   r$   r%   Úpandas.util._decoratorsr&   r'   r(   Úpandas.core.dtypes.commonr)   r*   Úpandas.core.dtypes.dtypesr+   r,   Úpandas.core.dtypes.genericr-   r.   r/   r0   Úpandas.core.dtypes.missingr1   rÿ   r2   r³   Úpandas.core.commonÚcoreÚcommonr   Úcollections.abcr3   r4   Úpandas._typingr5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   Úpandas.core.arrays.baser@   rA   r}  rW   ÚDatelikeOpsÚPeriodMixinrD   r�   r”  r�   r¶   r¾   r­  r½   rR   rO   Ú<module>rØ     s½  ðÝ "å Û ÷÷ ñ ó ã ÷õ .÷÷ ÷ õ ÷õ 6÷÷õ ÷ñ ÷÷÷ó õ ,å 2ß  Ð  æ÷÷
	÷ 	ó 	õ 9÷õ 7ñ �m¨:Ñ6€ð ˆ]ðÐ ö
ñ ˆOÓôH�#—/‘/ 9×#8Ñ#8ó Hó ðHôV !&ðT ,0Øð]9Ø
6ð]9à
(ð]9ð ð]9ð õ	]9ð@ 
Û Eó 
Ø Eð 
Û Oó 
Ø Oð"ØBð"àô"ðL ð%Nà-õ%NöP.ðd 
Ø
ØØØ	ØØØ	ð.4ð #õ.4õbrR   