Ë
    u™ãjƒ7  ã                  ól  — d dl mZ d dlZd dlmZmZmZmZ d dlZd dl	Z
d dlmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlm Z  d dl!m"Z"m#Z# erd dl$Z$d dl%m&Z&m'Z'm(Z( d dlm)Z) e ed«       G d„ de#«      «       «       Z*	 d	 	 	 dd„Z+ ed«       G d„ de"«      «       Z,y)é    )ÚannotationsN)ÚTYPE_CHECKINGÚClassVarÚSelfÚcast)ÚlibÚmissing)ÚPandas4Warning)Ú
set_module)Úfind_stack_level)Úis_list_like)Úregister_extension_dtype)Úisna)Úops)Úmasked_accumulations)ÚExtensionArray)ÚBaseMaskedArrayÚBaseMaskedDtype)ÚDtypeObjÚnptÚtype_t)ÚExtensionDtypeÚpandasc                  óž   — e Zd ZU dZdZded<   dZedd„«       Zedd„«       Z	edd„«       Z
dd	„Zdd
„Zedd„«       Zedd„«       Z	 	 	 	 dd„Zy)ÚBooleanDtypeaP  
    Extension dtype for boolean data.

    This is a pandas Extension dtype for boolean data with support for
    missing values. BooleanDtype is the dtype companion to :class:`.BooleanArray`,
    which implements Kleene logic (sometimes called three-value logic) for
    logical operations. See :ref:`boolean.kleene` for more.

    .. warning::

        BooleanDtype is considered experimental. The implementation and
        parts of the API may change without warning.

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

    Methods
    -------
    None

    See Also
    --------
    arrays.BooleanArray : Array of boolean (True/False) data with missing values.
    Int64Dtype : Extension dtype for int64 integer data.
    StringDtype : Extension dtype for string data.

    Examples
    --------
    >>> pd.BooleanDtype()
    BooleanDtype

    >>> pd.array([True, False, None], dtype=pd.BooleanDtype())
    <BooleanArray>
    [True, False, <NA>]
    Length: 3, dtype: boolean

    >>> pd.array([True, False, None], dtype="boolean")
    <BooleanArray>
    [True, False, <NA>]
    Length: 3, dtype: boolean
    ÚbooleanzClassVar[str]ÚnameFc                ó"   — t         j                  S ©N)ÚnpÚbool_©Úselfs    úe/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/core/arrays/boolean.pyÚtypezBooleanDtype.typec   s   € ä�x‰xˆó    c                 ó   — y)NÚb© r"   s    r$   ÚkindzBooleanDtype.kindg   s   € àr&   c                ó,   — t        j                  d«      S )NÚbool)r    Údtyper"   s    r$   Únumpy_dtypezBooleanDtype.numpy_dtypek   s   € ä�x‰x˜ÓÐr&   c                ó   — t         S )zq
        Return the array type associated with this dtype.

        Returns
        -------
        type
        )ÚBooleanArrayr"   s    r$   Úconstruct_array_typez!BooleanDtype.construct_array_typeo   s
   € ô Ðr&   c                 ó   — y)Nr   r)   r"   s    r$   Ú__repr__zBooleanDtype.__repr__y   s   € Ør&   c                 ó   — y©NTr)   r"   s    r$   Ú_is_booleanzBooleanDtype._is_boolean|   ó   € àr&   c                 ó   — yr5   r)   r"   s    r$   Ú_is_numericzBooleanDtype._is_numeric€   r7   r&   c                ó  — ddl }|j                   |j                  «       k7  r>|j                  j	                  |j                  «      st        d|j                  › d�«      ‚t        ||j                  «      r|g}t        |«      }n|j                  }|j                  «       }|j                  j	                  |j                  «      rBt        j                  |t        ¬«      }t        j                  |t        ¬«      }t        ||«      S g }|D �]	  }|j!                  «       }	|j                  j#                  |j                  t        |«      d|	d   g|j$                  ¬«      j'                  d¬	«      }|j(                  dk7  rU|j                  j#                  |j                  t        |«      d|	d   g|j$                  ¬«      j'                  d¬	«      }| }n$t        j*                  t        |«      t        ¬«      }t        ||«      }
|j-                  |
«       �Œ |sRt        t        j.                  g t        j                  ¬«      t        j.                  g t        j                  ¬«      «      S t        j1                  |«      S )
zI
        Construct BooleanArray from pyarrow Array/ChunkedArray.
        r   Nz$Expected array of boolean type, got z instead©r-   é   )ÚoffsetF)Úzero_copy_only)Úpyarrowr%   r!   ÚtypesÚis_nullÚ	TypeErrorÚ
isinstanceÚArrayÚlenÚchunksÚlengthr    Úonesr,   Úemptyr0   ÚbuffersÚfrom_buffersr=   Úto_numpyÚ
null_countÚzerosÚappendÚarrayÚ_concat_same_type)r#   rP   r?   rF   rG   ÚmaskÚdataÚresultsÚarrÚbuflistÚbool_arrs              r$   Ú__from_arrow__zBooleanDtype.__from_arrow__„   sú  € ó 	à�:‰:˜˜Ÿ™›Ò(°·±×1FÑ1FÀuÇzÁzÔ1RÜÐBÀ5Ç:Á:À,ÈhÐWÓXÐXä�e˜WŸ]™]Ô+Ø�WˆFÜ˜“Z‰Fð —\‘\ˆFØ—\‘\“^ˆFà�=‰=× Ñ  §¡Ô,Ü—7‘7˜6¬Ô.ˆDä—8‘8˜F¬$Ô/ˆDÜ  dÓ+Ð+àˆØó 	%ˆCØ—k‘k“mˆGØ×'Ñ'×4Ñ4Ø—‘œ#˜c›( T¨7°1©:Ð$6¸s¿z¹zð 5ó ç‰h eˆhÓ,ð ð �~‰~ Ò"Ø×+Ñ+×8Ñ8Ø—H‘Hœc #›h¨¨w°q©zÐ(:À3Ç:Á:ð 9ó ç‘(¨%�(Ó0ð ð �u‘ä—x‘x¤ C£´Ô5�ä# D¨$Ó/ˆHØ�N‰N˜8Ö$ð	%ñ  ÜÜ—‘˜¤2§8¡8Ô,¬b¯h©h°rÄÇÁÔ.Jóð ô  ×1Ñ1°'Ó:Ð:r&   N)Úreturnr%   )rY   Ústr)rY   znp.dtype)rY   ztype_t[BooleanArray])rY   r,   )rP   z$pyarrow.Array | pyarrow.ChunkedArrayrY   r0   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__Ú_internal_fill_valueÚpropertyr%   r*   r.   r1   r3   r6   r9   rX   r)   r&   r$   r   r   .   sŸ   … ñ)ðV $€Dˆ-Ó#ð !Ðð òó ðð òó ðð ò ó ð óóð òó ðð òó ðð/;Ø9ð/;à	ô/;r&   r   c                óZ  — t        | t        «      rK|�t        d«      ‚| j                  | j                  }} |r | j                  «       } |j                  «       }| |fS d}t        | t        j                  «      r2| j                  t        j                  k(  r|�rÊ| j                  «       } �n¸t        | t        j                  «      r«| j                  j                  dv r“t        | «      }t        j                  t        | «      t        ¬«      }| |    j                  t        «      || <   t        j                   ||    j                  | j                  «      | |    k(  «      st#        d«      ‚|} nót        j$                  | t&        ¬«      }t)        j*                  |d¬«      }d}|d	d
g|¢­vrt#        d«      ‚t-        dt        |«      «      }t        j                  t        | «      t        ¬«      } ||    j                  t        «      | | <   ||v rQt        j                   | |    j                  t.        «      ||    j                  t.        «      k(  «      st#        d«      ‚|€(|€&t        j                  | j0                  t        ¬«      }ny|€|}ntt        |t        j                  «      r8|j                  t        j                  k(  r|�||z  }n5|r3|j                  «       }n"t        j2                  |t        ¬«      }|�||z  }| j0                  |j0                  k7  rt        d«      ‚| |fS )a  
    Coerce the input values array to numpy arrays with a mask.

    Parameters
    ----------
    values : 1D list-like
    mask : bool 1D array, optional
    copy : bool, default False
        if True, copy the input

    Returns
    -------
    tuple of (values, mask)
    Nz'cannot pass mask for BooleanArray inputÚiufcbr;   zNeed to pass bool-like valuesT©Úskipna)ÚfloatingÚintegerzmixed-integer-floatr   rI   únpt.NDArray[np.bool_]z&values.shape and mask.shape must match)rC   r0   Ú
ValueErrorÚ_dataÚ_maskÚcopyr    Úndarrayr-   r!   r*   r   rN   rE   r,   ÚastypeÚallrB   ÚasarrayÚobjectr   Úinfer_dtyper   ÚfloatÚshaperP   )ÚvaluesrR   rl   Úmask_valuesÚvalues_boolÚvalues_objectÚinferred_dtypeÚinteger_likes           r$   Úcoerce_to_arrayr{   ¶   s§  € ô" �&œ,Ô'ØÐÜÐFÓGÐGØ—|‘| V§\¡\�ˆÙØ—[‘[“]ˆFØ—9‘9“;ˆDØ�tˆ|Ðà€KÜ�&œ"Ÿ*™*Ô%¨&¯,©,¼"¿(¹(Ò*BÚØ—[‘[“]ŠFÜ	�FœBŸJ™JÔ	'¨F¯L©L×,=Ñ,=ÀÑ,HÜ˜6“lˆä—h‘hœs 6›{´$Ô7ˆØ$*¨K¨<Ñ$8×$?Ñ$?ÄÓ$Eˆ�[�LÑ!ä�v‰vØ˜˜Ñ%×,Ñ,¨V¯\©\Ó:¸fÀkÀ\Ñ>RÑRô
ô Ð;Ó<Ð<à‰äŸ
™
 6´Ô8ˆäŸ™¨¸tÔDˆØEˆØ )¨WÐ!D°|Ñ!DÑDÜÐ;Ó<Ð<ô Ð2´D¸Ó4GÓHˆÜ—‘œ#˜f›+¬TÔ2ˆØ,¨k¨\Ñ:×AÑAÄ$ÓGˆ�ˆ|Ñð ˜lÑ*Ü�F‰FØ˜�|Ñ$×+Ñ+¬EÓ2Ø  + Ñ.×5Ñ5´eÓ<ñ=ôô
 Ð;Ó<Ð<à€|˜Ð+Ü�x‰x˜Ÿ™¬DÔ1‰Ø	ˆØ‰Ü	�Dœ"Ÿ*™*Ô	%¨$¯*©*¼¿¹Ò*@ØÐ"Ø˜+Ñ%‰DÙØ—9‘9“;‰Dä�x‰x˜¤DÔ)ˆØÐ"Ø˜+Ñ%ˆDà‡|�|�t—z‘zÒ!ÜÐAÓBÐBà�4ˆ<Ðr&   zpandas.arraysc                  ó.  ‡ — e Zd ZdZh d£Zh d£Zedˆ fd„«       Z	 d	 	 	 	 	 	 	 dˆ fd„Ze	dd„«       Z
eddddd	œ	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„«       Zej                  ej                  eej"                  fZeddœ	 	 	 	 	 dd„«       Zd„ Zddœ	 	 	 	 	 dd„Zˆ xZS )r0   as  
    Array of boolean (True/False) data with missing values.

    This is a pandas Extension array for boolean data, under the hood
    represented by 2 numpy arrays: a boolean array with the data and
    a boolean array with the mask (True indicating missing).

    BooleanArray implements Kleene logic (sometimes called three-value
    logic) for logical operations. See :ref:`boolean.kleene` for more.

    To construct a BooleanArray from generic array-like input, use
    :func:`pandas.array` specifying ``dtype="boolean"`` (see examples
    below).

    .. warning::

       BooleanArray is considered experimental. The implementation and
       parts of the API may change without warning.

    Parameters
    ----------
    values : numpy.ndarray
        A 1-d boolean-dtype array with the data.
    mask : numpy.ndarray
        A 1-d boolean-dtype array indicating missing values (True
        indicates missing).
    copy : bool, default False
        Whether to copy the `values` and `mask` arrays.

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

    Methods
    -------
    None

    Returns
    -------
    BooleanArray

    See Also
    --------
    array : Create an array from data with the appropriate dtype.
    BooleanDtype : Extension dtype for boolean data.
    Series : One-dimensional ndarray with axis labels (including time series).
    DataFrame : Two-dimensional, size-mutable, potentially heterogeneous tabular data.

    Examples
    --------
    Create a BooleanArray with :func:`pandas.array`:

    >>> pd.array([True, False, None], dtype="boolean")
    <BooleanArray>
    [True, False, <NA>]
    Length: 3, dtype: boolean
    >   ú1.0Ú1ÚTRUEÚTrueÚtrue>   ú0.0Ú0ÚFALSEÚFalseÚfalsec                óF   •— t         ‰| �  ||«      }t        «       |_        |S r   )ÚsuperÚ_simple_newr   Ú_dtype)Úclsru   rR   ÚresultÚ	__class__s       €r$   r‰   zBooleanArray._simple_newJ  s"   ø€ ä‘Ñ$ V¨TÓ2ˆÜ$›ˆŒØˆr&   Fc                óÌ   •— t        |t        j                  «      r|j                  t        j                  k(  st        d«      ‚t        «       | _        t        ‰| �%  |||¬«       y )NzIvalues should be boolean numpy array. Use the 'pd.array' function instead©rl   )
rC   r    rm   r-   r!   rB   r   rŠ   rˆ   Ú__init__)r#   ru   rR   rl   r�   s       €r$   r�   zBooleanArray.__init__P  sS   ø€ ô ˜6¤2§:¡:Ô.°6·<±<Ä2Ç8Á8Ò3KÜð2óð ô #“nˆŒÜ‰Ñ˜ ¨DÐÕ1r&   c                ó   — | j                   S r   )rŠ   r"   s    r$   r-   zBooleanArray.dtype[  s   € à�{‰{Ðr&   N)rl   Útrue_valuesÚfalse_valuesÚnone_valuesc               óJ  ‡‡
‡— | j                   j                  |xs g «      Š| j                  j                  |xs g «      Š
‰€g Šdˆ
ˆˆfd„}t        j                  |t
        ¬«      }t        |«      }	t        t        |||	    «      «      ||	 <   | j                  |||¬«      S )Nc                ó>   •— | ‰v ry| ‰v ry| ‰v ry t        | › d�«      ‚)NTFz cannot be cast to bool)ri   )ÚsÚfalse_values_unionr”   Útrue_values_unions    €€€r$   Ú
map_stringz:BooleanArray._from_sequence_of_strings.<locals>.map_stringp  s9   ø€ ØÐ%Ñ%ØØÐ(Ñ(ØØ�kÑ!Øä  A 3Ð&=Ð!>Ó?Ð?r&   r;   )r-   rl   )rY   zbool | None)
Ú_TRUE_VALUESÚunionÚ_FALSE_VALUESr    rP   rq   r   ÚlistÚmapÚ_from_sequence)r‹   Ústringsr-   rl   r’   r“   r”   rš   ÚscalarsrR   r˜   r™   s         `   @@r$   Ú_from_sequence_of_stringsz&BooleanArray._from_sequence_of_strings_  sž   ú€ ð  ×,Ñ,×2Ñ2°;Ò3DÀ"ÓEÐØ ×.Ñ.×4Ñ4°\Ò5GÀRÓHÐàÐØˆK÷	@ô —(‘(˜7¬&Ô1ˆÜ�G‹}ˆÜœc *¨g°t°e©nÓ=Ó>ˆ��‰Ø×!Ñ! '°¸TÐ!ÓBÐBr&   r�   c               ó.   — |r|dk(  sJ ‚t        ||¬«      S )Nr   r�   )r{   )r‹   Úvaluer-   rl   s       r$   Ú_coerce_to_arrayzBooleanArray._coerce_to_array�  s"   € ñ Ø˜IÒ%Ð%Ð%Ü˜u¨4Ô0Ð0r&   c                óö  — |j                   dv sJ ‚t        j                  | ||«       t        j                  |«      }d }t        |t        «      r|j                  |j                  }}nçt        |«      r²t        |t        t        t        j                  f«      sPt        j                  |«      s;t        j                   dt#        |«      j                   › d�t$        t'        «       ¬«       t        j(                  |d¬«      }|j*                  dkD  rt,        S t/        |d¬	«      \  }}n*t        |t        j0                  «      r|j3                  «       }|rI|t4        j6                  ur7t        j8                  |«      s"t;        d
t#        |«      j                   › d�«      ‚|s"t=        | «      t=        |«      k7  rt?        d«      ‚|j                   dv r0t        j@                  | j                  || j                  |«      \  }}nm|j                   dv r0t        jB                  | j                  || j                  |«      \  }}n/t        jD                  | j                  || j                  |«      \  }}| jG                  ||«      S )N>   Úor_ÚxorÚand_Úror_ÚrxorÚrand_zOperation with zŠ is deprecated. In a future version these will be treated as scalar-like. To retain the old behavior, explicitly wrap in a Series instead.)Ú
stacklevelr,   r;   r<   Fr�   z+'other' should be pandas.NA or a bool. Got z	 instead.zLengths must match>   r¨   r«   >   rª   r­   )$r[   r   Ú disallow_datetimelike_logical_opr   Ú	is_scalarrC   r0   rj   rk   r   rž   r   r    rm   Úhas_castable_attrÚwarningsÚwarnr%   r
   r   rp   ÚndimÚNotImplementedr{   r!   ÚitemÚ
libmissingÚNAÚis_boolrB   rE   ri   Ú	kleene_orÚ
kleene_andÚ
kleene_xorÚ_maybe_mask_result)r#   ÚotherÚopÚother_is_scalarrR   rŒ   s         r$   Ú_logical_methodzBooleanArray._logical_method‰  sô  € Ø�{‰{ÐMÑMÐMÐMÜ×,Ñ,¨T°5¸"Ô=ÜŸ-™-¨Ó.ˆØˆä�eœ\Ô*ØŸ+™+ u§{¡{�4‰EÜ˜%Ô ÜØœœn¬b¯j©jÐ9ôä×+Ñ+¨EÔ2Ü—‘Ø%¤d¨5£k×&:Ñ&:Ð%;ð <ð ô #Ü/Ó1õô —J‘J˜u¨FÔ3ˆEØ�z‰z˜AŠ~Ü%Ð%Ü)¨%°eÔ<‰KˆE‘4Ü˜œrŸx™xÔ(Ø—J‘J“LˆEá˜u¬J¯M©MÑ9Ä#Ç+Á+ÈeÔBTÜðÜ˜E“{×+Ñ+Ð,¨Ið7óð ñ
 ¤3 t£9´°E³
Ò#:ÜÐ1Ó2Ð2à�;‰;˜/Ñ)ÜŸ=™=¨¯©°U¸D¿J¹JÈÓM‰LˆF‘DØ�[‰[Ð-Ñ-ÜŸ>™>¨$¯*©*°e¸T¿Z¹ZÈÓN‰LˆF‘Dô Ÿ>™>¨$¯*©*°e¸T¿Z¹ZÈÓN‰LˆF�Dð ×&Ñ& v¨tÓ4Ð4r&   Trd   c               ó  — | j                   }| j                  }|dv r1t        t        |«      } |||fd|i|¤Ž\  }}| j	                  ||«      S ddlm}   ||j                  t        «      |«      j                  |fd|i|¤ŽS )N)ÚcumminÚcummaxre   r   )ÚIntegerArray)
rj   rk   Úgetattrr   r‰   Úpandas.core.arraysrÅ   rn   ÚintÚ_accumulate)r#   r   re   ÚkwargsrS   rR   r¿   rÅ   s           r$   rÉ   zBooleanArray._accumulate¹  s”   € ð �z‰zˆØ�z‰zˆØÐ'Ñ'ÜÔ-¨tÓ4ˆBÙ˜D $Ñ@¨vÐ@¸Ñ@‰JˆD�$Ø×#Ñ# D¨$Ó/Ð/å7àC‘< §¡¬CÓ 0°$Ó7×CÑCØñØ#ðØ'-ñð r&   )ru   ú
np.ndarrayrR   rh   rY   r   )F)ru   rË   rR   rË   rl   r,   rY   ÚNone)rY   r   )r¡   z	list[str]r-   r   rl   r,   r’   úlist[str] | Noner“   rÍ   r”   rÍ   rY   r0   )r-   r   rl   r,   rY   útuple[np.ndarray, np.ndarray])r   rZ   re   r,   rY   r   )r[   r\   r]   r^   r›   r�   Úclassmethodr‰   r�   ra   r-   r£   r    rm   ÚnumbersÚNumberr,   r!   Ú_HANDLED_TYPESr¦   rÁ   rÉ   Ú__classcell__)r�   s   @r$   r0   r0     sG  ø„ ñ8òt 8€LÚ;€Màôó ðð BGð	2Ø ð	2Ø(2ð	2Ø:>ð	2à	õ	2ð òó ðð ð Ø(,Ø)-Ø(,ñCàðCð ð	Cð
 ðCð &ðCð 'ðCð &ðCð 
òCó ðCð> —j‘j '§.¡.°$¸¿¹ÐA€Nàà5:ñ1Ø&ð1Ø.2ð1à	&ò1ó ð1ò.5ðb ,0ñØðØ$(ðà	÷r&   r0   )NF)rl   r,   rY   rÎ   )-Ú
__future__r   rÐ   Útypingr   r   r   r   r²   Únumpyr    Úpandas._libsr   r	   r·   Úpandas.errorsr
   Úpandas.util._decoratorsr   Úpandas.util._exceptionsr   Úpandas.core.dtypes.commonr   Úpandas.core.dtypes.dtypesr   Úpandas.core.dtypes.missingr   Úpandas.corer   Úpandas.core.array_algosr   rÇ   r   Úpandas.core.arrays.maskedr   r   r?   Úpandas._typingr   r   r   r   r   r{   r0   r)   r&   r$   ú<module>râ      sÈ   ðÝ "ã ÷ó ó ã ÷õ )Ý .Ý 4å 2Ý >Ý +å Ý 8Ý -÷ñ
 Û÷ñ õ 9ð ÙˆHÓôC;�?ó C;ó ó ðC;ðN %*ðRØ!ðRà"óRñj ˆOÓô{�?ó {ó ñ{r&   