Ë
    *�£j  ã                  ó¤   — d Z ddlmZ ddlmZ ddlZddlmZm	Z
 erddlmZ 	 	 	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 dd	„Zdd
„Zy)z
Ops for masked arrays.
é    )Úannotations)ÚTYPE_CHECKINGN)ÚlibÚmissing)Únptc                ó¾  — |€t        || ||«      S t        | t        j                  «      st	        d«      ‚t        |d¬«       |t        j                  u r| j                  «       }n| |z  }|�!| |z   }||z   }||z  ||z  z  ||z  z  }||fS |du rt        j                  |«      }||fS |t        j                  u r|  | z  |z  }||fS |j                  «       }||fS )a  
    Boolean ``or`` using Kleene logic.

    Values are NA where we have ``NA | NA`` or ``NA | False``.
    ``NA | True`` is considered True.

    Parameters
    ----------
    left, right : ndarray, NA, or bool
        The values of the array.
    left_mask, right_mask : ndarray, optional
        The masks. Only one of these may be None, which implies that
        the associated `left` or `right` value is a scalar.

    Returns
    -------
    result, mask: ndarray[bool]
        The result of the logical or, and the new mask.
    ú2Either `left` or `right` need to be an np.ndarray.Úor©ÚmethodT)
Ú	kleene_orÚ
isinstanceÚnpÚndarrayÚ	TypeErrorÚraise_for_nanÚ
libmissingÚNAÚcopyÚ
zeros_like)ÚleftÚrightÚ	left_maskÚ
right_maskÚresultÚ
left_falseÚright_falseÚmasks           ú:C:\FundamentalWorkbench\vendor\pandas\core\ops\mask_ops.pyr   r      s  € ð8 ÐÜ˜  j°)Ó<Ð<ä�dœBŸJ™JÔ'ÜÐLÓMÐMä�% Õ%à”
—‘ÑØ—‘“‰à˜‘ˆàÐà˜iÑ'Ð(ˆ
Ø 
Ñ*Ð+ˆà˜*Ñ$Ø˜YÑ&ñ(à˜:Ñ%ñ'ð 	ð �4ˆ<Ðð 
�$‰Ü�}‰}˜YÓ'ˆð �4ˆ<Ðð 
”*—-‘-Ñ	Ø�˜˜
Ñ" iÑ/ˆð
 �4ˆ<Ðð �~‰~Óˆà�4ˆ<Ðó    c                ót  — |€t        || ||«      S t        | t        j                  «      st	        d«      ‚t        |d¬«       |t        j                  u rt        j                  | «      }n| |z  }|€?|t        j                  u rt        j                  |«      }||fS |j                  «       }||fS ||z  }||fS )a'  
    Boolean ``xor`` using Kleene logic.

    This is the same as ``or``, with the following adjustments

    * True, True -> False
    * True, NA   -> NA

    Parameters
    ----------
    left, right : ndarray, NA, or bool
        The values of the array.
    left_mask, right_mask : ndarray, optional
        The masks. Only one of these may be None, which implies that
        the associated `left` or `right` value is a scalar.

    Returns
    -------
    result, mask: ndarray[bool]
        The result of the logical xor, and the new mask.
    r	   Úxorr   )Ú
kleene_xorr   r   r   r   r   r   r   r   Ú	ones_liker   )r   r   r   r   r   r   s         r   r#   r#   Q   s¾   € ð< ÐÜ˜%  z°9Ó=Ð=ä�dœBŸJ™JÔ'ÜÐLÓMÐMä�% Õ&Ø”
—‘ÑÜ—‘˜tÓ$‰à˜‘ˆàÐØ”J—M‘MÑ!Ü—<‘< 	Ó*ˆDð �4ˆ<Ðð	 —>‘>Ó#ˆDð �4ˆ<Ðð ˜:Ñ%ˆà�4ˆ<Ðr    c                ó–  — |€t        || ||«      S t        | t        j                  «      st	        d«      ‚t        |d¬«       |t        j                  u rt        j                  | «      }n| |z  }|€<|t        j                  u r| | z  |z  }||fS |j                  «       }|du rd|dd ||fS | |z   }||z   }|| z  || z  z  }||fS )aî  
    Boolean ``and`` using Kleene logic.

    Values are ``NA`` for ``NA & NA`` or ``True & NA``.

    Parameters
    ----------
    left, right : ndarray, NA, or bool
        The values of the array.
    left_mask, right_mask : ndarray, optional
        The masks. Only one of these may be None, which implies that
        the associated `left` or `right` value is a scalar.

    Returns
    -------
    result, mask: ndarray[bool]
        The result of the logical xor, and the new mask.
    Nr	   Úandr   F)
Ú
kleene_andr   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   s           r   r'   r'   †   sù   € ð6 ÐÜ˜%  z°9Ó=Ð=ä�dœBŸJ™JÔ'ÜÐLÓMÐMÜ�% Õ&à”
—‘ÑÜ—‘˜tÓ$‰à˜‘ˆàÐà”J—M‘MÑ!Ø˜I˜:Ñ%¨Ñ2ˆDð �4ˆ<Ðð —>‘>Ó#ˆDØ˜‰~à�‘Q�ð �4ˆ<Ðð	 ˜iÑ'Ð(ˆ
Ø 
Ñ*Ð+ˆØ˜[˜LÑ(¨Z¸:¸+Ñ-EÑFˆà�4ˆ<Ðr    c                óx   — t        j                  | «      r%t        j                  | «      rt	        d|› d�«      ‚y y )NzCannot perform logical 'z' with floating NaN)r   Úis_floatr   ÚisnanÚ
ValueError)Úvaluer   s     r   r   r   À   s6   € Ü
‡|�|�EÔœrŸx™x¨œÜÐ3°F°8Ð;NÐOÓPÐPð  /Ðr    )
r   ú%bool | np.ndarray | libmissing.NATyper   r-   r   únp.ndarray | Noner   r.   Úreturnú3tuple[npt.NDArray[np.bool_], npt.NDArray[np.bool_]])
r   ú%bool | libmissing.NAType | np.ndarrayr   r1   r   r.   r   r.   r/   r0   )r,   Úobjectr   Ústrr/   ÚNone)Ú__doc__Ú
__future__r   Útypingr   Únumpyr   Úpandas._libsr   r   r   Úpandas._typingr   r   r#   r'   r   © r    r   Ú<module>r<      sÄ   ðñõ #å  ã ÷ñ
 Ý"ð:Ø
/ð:à0ð:ð !ð:ð "ð	:ð
 9ó:ðz2Ø
/ð2à0ð2ð !ð2ð "ð	2ð
 9ó2ðj7Ø
/ð7à0ð7ð !ð7ð "ð	7ð
 9ó7ôtQr    