§
    Ñ! hå  ã                  ó6  — d Z ddlmZ ddlZddlZddlmZ ddlm	Z	m
Z
mZ ddlZej        rddlmZ i dd“d	d
“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d!“d"d#“d$d%“d&d'“d(d)d*d+d,d-d.d/d0d1d2d3d4d5œ¥Z G d6„ d7¦  «        Z G d8„ d9¦  «        ZdDd>„ZdEdC„ZdS )FzE
Utility functions and objects for implementing the interchange API.
é    )ÚannotationsN)Úlib)Ú
ArrowDtypeÚCategoricalDtypeÚDatetimeTZDtype)ÚDtypeObjÚnullÚnÚboolÚbÚuint8ÚCÚuint16ÚSÚuint32ÚIÚuint64ÚLÚint8ÚcÚint16Úint32ÚiÚint64ÚlÚ	halffloatÚeÚfloatÚfÚdoubleÚgÚstringÚuÚlarge_stringÚUÚbinaryÚzz	time32[s]ÚttsÚttmÚttuÚttnÚtdDÚtdmztss:ztsm:ztsu:ztsn:ÚtDsÚtDmÚtDuÚtDn)z
time32[ms]z
time64[us]z
time64[ns]zdate32[day]z
date64[ms]ztimestamp[s]ztimestamp[ms]ztimestamp[us]ztimestamp[ns]zduration[s]zduration[ms]zduration[us]zduration[ns]c                  ó^   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdS )ÚArrowCTypesz¹
    Enum for Apache Arrow C type format strings.

    The Arrow C data interface:
    https://arrow.apache.org/docs/format/CDataInterface.html#data-type-description-format-strings
    r
   r   r   r   Úsr   r   r   r   r   r   r   r!   r#   r%   r,   r-   zts{resolution}:{tz}ztt{resolution}N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚNULLÚBOOLÚINT8ÚUINT8ÚINT16ÚUINT16ÚINT32ÚUINT32ÚINT64ÚUINT64ÚFLOAT16ÚFLOAT32ÚFLOAT64ÚSTRINGÚLARGE_STRINGÚDATE32ÚDATE64Ú	TIMESTAMPÚTIME© ó    úWc:\xampp_lite_8_4\www\timesheet\venv\Lib\site-packages\pandas/core/interchange/utils.pyr3   r3   =   s{   € € € € € ðð ð €DØ€DØ€DØ€EØ€EØ€FØ€EØ€FØ€EØ€FØ€GØ€GØ€GØ€FØ€LØ€FØ€Fð &€IØ€D€D€DrM   r3   c                  ó"   — e Zd ZdZdZdZdZdZdS )Ú
Endiannessz.Enum indicating the byte-order of a data-type.ú<ú>ú=ú|N)r5   r6   r7   r8   ÚLITTLEÚBIGÚNATIVEÚNArL   rM   rN   rP   rP   _   s(   € € € € € Ø8Ð8à€FØ
€CØ€FØ	€B€B€BrM   rP   Údtyper   ÚreturnÚstrc                óú  — t          | t          ¦  «        rt          j        S | t	          j        d¦  «        k    rt          j        S t          | t          ¦  «        rœddl}| j	        }|j
                             |¦  «        rd|j        › d|j        › �S |j
                             |¦  «        r|j        �d|j        d         › d|j        › �S t"                               t'          |¦  «        d¦  «        }|�|S t)          t          | j                             ¦   «         d¦  «        }|�|S t/          j        | d¦  «        rAt	          j        | ¦  «        d         d         }t          j                             |d	¬
¦  «        S t          | t8          ¦  «        r1t          j                             | j        d         | j        ¬
¦  «        S t          | t:          j        ¦  «        rt          j        S tA          d| › d�¦  «        ‚)a   
    Represent pandas `dtype` as a format string in Apache Arrow C notation.

    Parameters
    ----------
    dtype : np.dtype
        Datatype of pandas DataFrame to represent.

    Returns
    -------
    str
        Format string in Apache Arrow C notation of the given `dtype`.
    ÚOr   Nzd:ú,Útsú:ÚMÚ )Ú
resolutionÚtzzConversion of z- to Arrow C format string is not implemented.)!Ú
isinstancer   r3   rA   ÚnprY   rF   r   ÚpyarrowÚpyarrow_dtypeÚtypesÚ
is_decimalÚ	precisionÚscaleÚis_timestamprd   ÚunitÚPYARROW_CTYPESÚgetr[   ÚgetattrÚnameÚupperr   Úis_np_dtypeÚdatetime_datarJ   Úformatr   ÚpdÚBooleanDtyper:   ÚNotImplementedError)rY   ÚpaÚpa_typeÚ
format_strrc   s        rN   Údtype_to_arrow_c_fmtr}   h   sã  € õ �%Õ)Ñ*Ô*ð ÝÔ Ð Ø	•"”(˜3‘-”-Ò	Ð	ÝÔ!Ð!Ý	�E�:Ñ	&Ô	&ð 
ØÐÐÐàÔ%ˆØŒ8×Ò˜wÑ'Ô'ð 	7Ø;˜Ô)Ð;Ð;¨G¬MÐ;Ð;Ð;ØŒX×"Ò" 7Ñ+Ô+ð 	7°´
Ð0FØ6˜œ QœÐ6Ð6¨'¬*Ð6Ð6Ð6Ý#×'Ò'­¨G©¬°dÑ;Ô;ˆ
ØÐ!ØÐå� e¤j×&6Ò&6Ñ&8Ô&8¸$Ñ?Ô?€JØÐØÐå
„�u˜cÑ"Ô"ð 
 õ Ô% eÑ,Ô,¨QÔ/°Ô2ˆ
ÝÔ$×+Ò+°zÀbÐ+ÑIÔIÐIå	�E�?Ñ	+Ô	+ð  ÝÔ$×+Ò+°u´zÀ!´}ÈÌÐ+ÑRÔRÐRå	�E�2œ?Ñ	+Ô	+ð  ÝÔÐå
ØM˜ÐMÐMÐMñô ð rM   Úseriesú	pd.SeriesÚ
allow_copyúpd.Series | Nonec               ó(  — t          | j        t          j        ¦  «        sdS | j        j        }t          |j        ¦  «        dk    rdS |st          d¦  «        ‚| 	                    ¦   «         }t          j
        || j        | j        | j        ¬¦  «        S )aË  
    Rechunk a multi-chunk pyarrow array into a single-chunk array, if necessary.

    - Returns `None` if the input series is not backed by a multi-chunk pyarrow array
      (and so doesn't need rechunking)
    - Returns a single-chunk-backed-Series if the input is backed by a multi-chunk
      pyarrow array and `allow_copy` is `True`.
    - Raises a `RuntimeError` if `allow_copy` is `False` and input is a
      based by a multi-chunk pyarrow array.
    Né   zŒFound multi-chunk pyarrow array, but `allow_copy` is False. Please rechunk the array before calling this function, or set `allow_copy=True`.)rY   rr   Úindex)re   rY   rw   r   ÚarrayÚ	_pa_arrayÚlenÚchunksÚRuntimeErrorÚcombine_chunksÚSeriesrr   r„   )r~   r€   Úchunked_arrayÚarrs       rN   Úmaybe_rechunkrŽ   ›   s•   € õ �f”l¥B¤MÑ2Ô2ð ØˆtØ”LÔ*€MÝ
ˆ=ÔÑ Ô  AÒ%Ð%ØˆtØð 
Ýð!ñ
ô 
ð 	
ð
 ×
&Ò
&Ñ
(Ô
(€CÝŒ9�S ¤°6´;ÀfÄlÐSÑSÔSÐSrM   )rY   r   rZ   r[   )r~   r   r€   r   rZ   r�   )r8   Ú
__future__r   ÚtypingÚnumpyrf   Úpandas._libsr   Úpandas.core.dtypes.dtypesr   r   r   Úpandasrw   ÚTYPE_CHECKINGÚpandas._typingr   ro   r3   rP   r}   rŽ   rL   rM   rN   ú<module>r—      s9  ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€à Ð Ð Ð à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð Ð Ð Ð à	Ôð (Ø'Ð'Ð'Ð'Ð'Ð'ð
Ø
ˆCðà
ˆCðð ˆSðð ˆcð	ð
 ˆcðð ˆcðð ˆCðð ˆSðð ˆSðð ˆSðð �ðð ˆSðð ˆcðð ˆcðð �Cðð  ˆcð!ð" �ð#ð$ ØØØØØØØØØØØØð=ð ð €ðDð ð ð ð ñ ô ð ðDð ð ð ð ñ ô ð ð0ð 0ð 0ð 0ðfTð Tð Tð Tð Tð TrM   