ó
    Ñ]jf4  ã                  óN  • S SK Jr  S SKrS SKJrJrJrJr  S SK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  S SKJrJr  \(       a  S SKrS SKJrJ r J!r!  S SKJ"r"  \\" S5       " S S\5      5       5       r# S   SS jjr$\" S5       " S S\5      5       r%g)é    )ÚannotationsN)ÚTYPE_CHECKINGÚClassVarÚSelfÚcast)ÚlibÚmissing)Ú
set_module)Úis_list_like)Úregister_extension_dtype)Úisna)Úops)Úmasked_accumulations)ÚBaseMaskedArrayÚBaseMaskedDtype)ÚDtypeObjÚnptÚtype_t)ÚExtensionDtypeÚpandasc                  ó¶   • \ rS rSr% SrSrS\S'   Sr\SS j5       r	\SS j5       r
\SS	 j5       rSS
 jrSS jr\SS j5       r\SS j5       r    SS jrSrg)ÚBooleanDtypeé*   aÐ  
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                ó"   • [         R                  $ ©N)ÚnpÚbool_©Úselfs    ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pandas/core/arrays/boolean.pyÚtypeÚBooleanDtype.type_   s   € ä�x‰xˆó    c                ó   • g)NÚb© r    s    r"   ÚkindÚBooleanDtype.kindc   s   € àr%   c                ó.   • [         R                  " S5      $ )NÚbool)r   Údtyper    s    r"   Únumpy_dtypeÚBooleanDtype.numpy_dtypeg   s   € ä�xŠx˜ÓÐr%   c                ó   • [         $ )zI
Return the array type associated with this dtype.

Returns
-------
type
)ÚBooleanArrayr    s    r"   Úconstruct_array_typeÚ!BooleanDtype.construct_array_typek   s
   € ô Ðr%   c                ó   • g)Nr   r(   r    s    r"   Ú__repr__ÚBooleanDtype.__repr__u   s   € Ør%   c                ó   • g©NTr(   r    s    r"   Ú_is_booleanÚBooleanDtype._is_booleanx   ó   € àr%   c                ó   • gr8   r(   r    s    r"   Ú_is_numericÚBooleanDtype._is_numeric|   r;   r%   c                ó   • SSK nUR                  UR                  " 5       :w  aC  UR                  R	                  UR                  5      (       d  [        SUR                   S35      e[        XR                  5      (       a  U/n[        U5      nOUR                  nUR                  5       nUR                  R	                  UR                  5      (       a=  [        R                  " U[        S9n[        R                  " U[        S9n[        Xe5      $ / nU Hû  nUR!                  5       n	UR                  R#                  UR                  [        U5      SU	S   /UR$                  S9R'                  SS	9nUR(                  S:w  aO  UR                  R#                  UR                  [        U5      SU	S   /UR$                  S9R'                  SS	9nU) nO"[        R*                  " [        U5      [        S9n[        Xe5      n
UR-                  U
5        Mý     U(       dN  [        [        R.                  " / [        R                  S9[        R.                  " / [        R                  S95      $ [        R1                  U5      $ )
z9
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,   Úemptyr1   ÚbuffersÚfrom_buffersrB   Úto_numpyÚ
null_countÚzerosÚappendÚarrayÚ_concat_same_type)r!   rU   rD   rK   rL   ÚmaskÚdataÚresultsÚarrÚbuflistÚbool_arrs              r"   Ú__from_arrow__ÚBooleanDtype.__from_arrow__€   sö  € ó 	à�:‰:˜Ÿš›Ó(°·±×1FÑ1FÀuÇzÁz×1RÑ1RÜÐBÀ5Ç:Á:À,ÈhÐWÓXÐXä�eŸ]™]×+Ñ+Ø�WˆFÜ˜“Z‰Fð —\‘\ˆFØ—\‘\“^ˆFà�=‰=× Ñ  §¡×,Ñ,Ü—7’7˜6¬Ñ.ˆDä—8’8˜F¬$Ñ/ˆ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%   r(   N)Úreturnr#   )r_   Ústr)r_   znp.dtype)r_   ztype_t[BooleanArray])r_   r,   )rU   z$pyarrow.Array | pyarrow.ChunkedArrayr_   r1   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__Ú_internal_fill_valueÚpropertyr#   r)   r.   r2   r5   r9   r=   r]   Ú__static_attributes__r(   r%   r"   r   r   *   sŸ   ‡ ñ)ðV $€Dˆ-Ó#ð !Ðð óó ðð óó ðð ó ó ð ôôð óó ðð óó ðð/;Ø9ð/;à	÷/;r%   r   c                ó   • [        U [        5      (       aO  Ub  [        S5      eU R                  U R                  pU(       a   U R                  5       n UR                  5       nX4$ Sn[        U [        R                  5      (       a7  U R                  [        R                  :X  a  U(       a  U R                  5       n GO¾[        U [        R                  5      (       a­  U R                  R                  S;   a“  [        U 5      n[        R                  " [        U 5      [        S9nX)    R                  [        5      XC) '   [        R                   " XC)    R                  U R                  5      X)    :H  5      (       d  [#        S5      eUn Oò[        R$                  " U [&        S9n[(        R*                  " USS9nSnUS	S
/UQ7;  a  [#        S5      e[-        S[        U5      5      n[        R                  " [        U 5      [        S9n XS)    R                  [        5      X) '   Xg;   aU  [        R                   " X)    R                  [.        5      XS)    R                  [.        5      :H  5      (       d  [#        S5      eUc'  Uc$  [        R                  " U R0                  [        S9nOƒUc  UnO}[        U[        R                  5      (       a>  UR                  [        R                  :X  a   Ub  X-  nO8U(       a  UR                  5       nO [        R2                  " U[        S9nUb  X-  nU R0                  UR0                  :w  a  [        S5      eX4$ )zè
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   rN   únpt.NDArray[np.bool_]z&values.shape and mask.shape must match)rH   r1   Ú
ValueErrorÚ_dataÚ_maskÚcopyr   Úndarrayr-   r   r)   r   rS   rJ   r,   ÚastypeÚallrG   ÚasarrayÚobjectr   Úinfer_dtyper   ÚfloatÚshaperU   )ÚvaluesrW   rt   Úmask_valuesÚvalues_boolÚvalues_objectÚinferred_dtypeÚinteger_likes           r"   Úcoerce_to_arrayrƒ   ²   s£  € ô" �&œ,×'Ñ'ØÑÜÐFÓGÐGØ—|‘| V§\¡\�ÞØ—[‘[“]ˆFØ—9‘9“;ˆDØˆ|Ðà€KÜ�&œ"Ÿ*™*×%Ñ%¨&¯,©,¼"¿(¹(Ó*BÞØ—[‘[“]ˆFùÜ	�FœBŸJ™J×	'Ñ	'¨F¯L©L×,=Ñ,=ÀÓ,HÜ˜6“lˆä—h’hœs 6›{´$Ñ7ˆØ$*¨<Ñ$8×$?Ñ$?ÄÓ$Eˆ�LÑ!ä�vŠvØ˜Ñ%×,Ñ,¨V¯\©\Ó:¸fÀ\Ñ>RÑR÷
ñ 
ô Ð;Ó<Ð<à‰äŸ
š
 6´Ñ8ˆäŸš¨¸tÑDˆØEˆØ )¨WÐ!D°|Ñ!DÓDÜÐ;Ó<Ð<ô Ð2´D¸Ó4GÓHˆÜ—’œ#˜f›+¬TÑ2ˆØ,¨\Ñ:×AÑAÄ$ÓGˆˆ|Ñð Ó*Ü�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àˆ<Ðr%   zpandas.arraysc                  óN  ^ • \ rS rSrSr1 Skr1 Skr\SU 4S jj5       r S       SU 4S jjjr	\
SS j5       r\SS	S	S	S
.             SS jj5       r\R                  \R                   \\R$                  4r\SS.     SS jj5       rS rSS.     SS jjrSrU =r$ )r1   i  aÃ  
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ÚTRUEÚTrueÚtrueú1.0>   Ú0ÚFALSEÚFalseÚfalseú0.0c                óD   >• [         TU ]  X5      n[        5       Ul        U$ r   )ÚsuperÚ_simple_newr   Ú_dtype)Úclsr}   rW   ÚresultÚ	__class__s       €r"   r‘   ÚBooleanArray._simple_newF  s    ø€ ä‘Ñ$ VÓ2ˆÜ$›ˆŒØˆr%   Fc                óÐ   >• [        U[        R                  5      (       a  UR                  [        R                  :X  d  [        S5      e[        5       U l        [        TU ]%  XUS9  g )NzIvalues should be boolean numpy array. Use the 'pd.array' function instead©rt   )
rH   r   ru   r-   r   rG   r   r’   r�   Ú__init__)r!   r}   rW   rt   r•   s       €r"   r™   ÚBooleanArray.__init__L  sT   ø€ ô ˜6¤2§:¡:×.Ñ.°6·<±<Ä2Ç8Á8Ó3KÜð2óð ô #“nˆŒÜ‰Ñ˜¨DÐÒ1r%   c                ó   • U R                   $ r   ©r’   r    s    r"   r-   ÚBooleanArray.dtypeW  s   € à�{‰{Ðr%   N)rt   Útrue_valuesÚfalse_valuesÚnone_valuesc               óT  ^^
^• U R                   R                  U=(       d    / 5      mU R                  R                  U=(       d    / 5      m
Tc  / mSU
UU4S jjn[        R                  " U[
        S9n[        U5      n	[        [        XxU	)    5      5      X‰) '   U R                  X‚US9$ )Nc                óJ   >• U T;   a  gU T;   a  gU T;   a  g [        U  S35      e)NTFz cannot be cast to bool)rq   )ÚsÚfalse_values_unionr    Útrue_values_unions    €€€r"   Ú
map_stringÚ:BooleanArray._from_sequence_of_strings.<locals>.map_stringl  s9   ø€ ØÐ%Ó%ØØÐ(Ó(ØØ�kÓ!Øä  A 3Ð&=Ð!>Ó?Ð?r%   r@   )r-   rt   )r_   zbool | None)
Ú_TRUE_VALUESÚunionÚ_FALSE_VALUESr   rU   ry   r   ÚlistÚmapÚ_from_sequence)r“   Ústringsr-   rt   rž   rŸ   r    r¦   ÚscalarsrW   r¤   r¥   s         `   @@r"   Ú_from_sequence_of_stringsÚ&BooleanArray._from_sequence_of_strings[  sž   ú€ ð  ×,Ñ,×2Ñ2°;×3DÀ"ÓEÐØ ×.Ñ.×4Ñ4°\×5GÀRÓHÐàÑØˆK÷	@ñ 	@ô —(’(˜7¬&Ñ1ˆÜ�G‹}ˆÜœc *°t°e©nÓ=Ó>ˆ�‰Ø×!Ñ! '¸TÐ!ÐBÐBr%   r˜   c               ó2   • U(       a  US:X  d   e[        XS9$ )Nr   r˜   )rƒ   )r“   Úvaluer-   rt   s       r"   Ú_coerce_to_arrayÚBooleanArray._coerce_to_array}  s    € ö Ø˜IÓ%Ð%Ð%Ü˜uÑ0Ð0r%   c                ó  • UR                   S;   d   e[        R                  " U5      nS n[        U[        5      (       a  UR
                  UR                  pAOw[        U5      (       a8  [        R                  " USS9nUR                  S:”  a  [        $ [        USS9u  pO/[        U[        R                  5      (       a  UR                  5       nU(       aP  U[        R                   La=  [        R"                  " U5      (       d"  [%        S['        U5      R                    S35      eU(       d#  [)        U 5      [)        U5      :w  a  [+        S	5      eUR                   S
;   a/  [,        R.                  " U R
                  XR                  U5      u  pTOmUR                   S;   a/  [,        R0                  " U R
                  XR                  U5      u  pTO.[,        R2                  " U R
                  XR                  U5      u  pTU R5                  XT5      $ )N>   Úor_ÚxorÚand_Úror_ÚrxorÚrand_r,   r@   rA   Fr˜   z+'other' should be pandas.NA or a bool. Got z	 instead.zLengths must match>   r·   rº   >   r¹   r¼   )ra   r   Ú	is_scalarrH   r1   rr   rs   r   r   rx   ÚndimÚNotImplementedrƒ   r   ÚitemÚ
libmissingÚNAÚis_boolrG   r#   rJ   rq   r   Ú	kleene_orÚ
kleene_andÚ
kleene_xorÚ_maybe_mask_result)r!   ÚotherÚopÚother_is_scalarrW   r”   s         r"   Ú_logical_methodÚBooleanArray._logical_method…  s‡  € Ø�{‰{ÐMÓMÐMÐMÜŸ-š-¨Ó.ˆØˆä�eœ\×*Ñ*ØŸ+™+ u§{¡{‘4Ü˜%× Ñ Ü—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ÑBTÜðÜ˜E“{×+Ñ+Ð,¨Ið7óð ö
 ¤3 t£9´°E³
Ó#:ÜÐ1Ó2Ð2à�;‰;˜/Ó)ÜŸ=š=¨¯©°U¿J¹JÈÓM‰LˆF�DØ�[‰[Ð-Ó-ÜŸ>š>¨$¯*©*°e¿Z¹ZÈÓN‰LˆF�Dô Ÿ>š>¨$¯*©*°e¿Z¹ZÈÓN‰LˆFð ×&Ñ& vÓ4Ð4r%   Trl   c               ó  • U R                   nU R                  nUS;   a.  [        [        U5      nU" XE4SU0UD6u  pEU R	                  XE5      $ SSKJn  U" UR                  [        5      U5      R                  " U4SU0UD6$ )N)ÚcumminÚcummaxrm   r   )ÚIntegerArray)
rr   rs   Úgetattrr   r‘   Úpandas.core.arraysrÐ   rv   ÚintÚ_accumulate)r!   r   rm   ÚkwargsrX   rW   rÉ   rÐ   s           r"   rÔ   ÚBooleanArray._accumulate¨  sŒ   € ð �z‰zˆØ�z‰zˆØÐ'Ó'ÜÔ-¨tÓ4ˆBÙ˜DÑ@¨vÐ@¸Ñ@‰JˆDØ×#Ñ# DÓ/Ð/å7á §¡¬CÓ 0°$Ó7×CÒCØñØ#ðØ'-ñð r%   rœ   )r}   ú
np.ndarrayrW   rp   r_   r   )F)r}   r×   rW   r×   rt   r,   r_   ÚNone)r_   r   )r®   z	list[str]r-   r   rt   r,   rž   úlist[str] | NonerŸ   rÙ   r    rÙ   r_   r1   )r-   r   rt   r,   r_   útuple[np.ndarray, np.ndarray])r   r`   rm   r,   r_   r   )ra   rb   rc   rd   re   r¨   rª   Úclassmethodr‘   r™   rh   r-   r°   r   ru   ÚnumbersÚNumberr,   r   Ú_HANDLED_TYPESr´   rË   rÔ   ri   Ú__classcell__)r•   s   @r"   r1   r1     sQ  ø† ñ8òt 8€LÚ;€Màöó ðð BGð	2Ø ð	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ðH ,0ñØðØ$(ðà	÷ó r%   r1   )NF)rt   r,   r_   rÚ   )&Ú
__future__r   rÜ   Útypingr   r   r   r   Únumpyr   Úpandas._libsr   r	   rÁ   Úpandas.util._decoratorsr
   Úpandas.core.dtypes.commonr   Úpandas.core.dtypes.dtypesr   Úpandas.core.dtypes.missingr   Úpandas.corer   Úpandas.core.array_algosr   Úpandas.core.arrays.maskedr   r   rD   Úpandas._typingr   r   r   r   r   rƒ   r1   r(   r%   r"   Ú<module>rì      s¼   ðÝ "ã ÷ó ó ÷õ /å 2Ý >Ý +å Ý 8÷ö
 Û÷ñ õ 9ð ÙˆHÓôC;�?ó C;ó ó ðC;ðN %*ðRØ!ðRà"õRñj ˆOÓôn�?ó nó ñnr%   