1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
U
¬ý°dÞã@sxdZddlmZddlZddlmZmZdddddœdd    „Z    dddddœd
d „Z
d d dddœd d„Z dddœdd„Z dS)z
Ops for masked arrays.
é)Ú annotationsN)ÚlibÚmissingz%bool | np.ndarray | libmissing.NATypeznp.ndarray | None)ÚleftÚrightÚ    left_maskÚ
right_maskcCsÈ|dkrt||||ƒSt|tjƒs*tdƒ‚t|dd|tjkrJ| ¡}n||B}|dk    rˆ||B}||B}||@||@B||@B}n8|dkrœt     |¡}n$|tjkr¸||@|B}n| ¡}||fS)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.
    Nú1Either `left` or `right` need to be a np.ndarray.Úor©ÚmethodT)
Ú    kleene_orÚ
isinstanceÚnpÚndarrayÚ    TypeErrorÚ raise_for_nanÚ
libmissingÚNAÚcopyÚ
zeros_like)rrrrÚresultÚ
left_falseÚ right_falseÚmask©rúOd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/ops/mask_ops.pyr s.  
 
 
 
ÿþÿ 
r cCsŒ|dkrt||||ƒSt|tjƒs*tdƒ‚t|dd|tjkrLt |¡}n||A}|dkr||tjkrrt     |¡}q„| 
¡}n||B}||fS)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.
    Nr    Úxorr ) Ú
kleene_xorrrrrrrrrZ    ones_liker)rrrrrrrrrrLs  
 
 
rz%bool | libmissing.NAType | np.ndarraycCsÄ|dkrt||||ƒSt|tjƒs*tdƒ‚t|dd|tjkrLt |¡}n||@}|dkr”|tjkrv||@|B}q¼|     ¡}|dkr¼d|dd…<n(||B}||B}||@||@B}||fS)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_andrrrrrrrrr)rrrrrrrrrrrr s$  
 
 
 
r ÚstrÚNone)r ÚreturncCs(t |¡r$t |¡r$td|›dƒ‚dS)NzCannot perform logical 'z' with floating NaN)rZis_floatrÚisnanÚ
ValueError)Úvaluer rrrr»sr) Ú__doc__Ú
__future__rÚnumpyrZ pandas._libsrrrr rr rrrrrÚ<module>s >5: