hyb
2025-11-10 e0a856b5072c5a09f3f6de6da85abf90e00ee704
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
Ë
nñúh‡Jãó—dZddlmZddlZddlmZddlZddlmZm    Z    ddl
Z
ddl Z ddl mZmZmZmZmZddlmZmZmZmZddlmZdd    lmZmZdd
lmZm Z m!Z!m"Z"m#Z#m$Z$dd l%m&Z&m'Z'm(Z(dd l)m*Z*m+Z+dd l,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7erddl8m9Z9m:Z:d„Z;d„Z<dd„Z=d d!d„Z>d"d„Z?d#d„Z@dd„ZAd#d„ZBd„ZCd$d„ZDejŠe-jŒejŽe-jej’e-j”hZKd%d„ZLy)&zY
Functions for arithmetic and comparison operations on NumPy arrays and
ExtensionArrays.
é)Ú annotationsN)Úpartial)Ú TYPE_CHECKINGÚAny)ÚNaTÚ    TimedeltaÚ    TimestampÚlibÚops)Ú
BaseOffsetÚget_supported_dtypeÚis_supported_dtypeÚ is_unitless)Úfind_stack_level)Ú'construct_1d_object_array_from_listlikeÚfind_common_type)Ú ensure_objectÚ is_bool_dtypeÚ is_list_likeÚis_numeric_v_string_likeÚis_object_dtypeÚ    is_scalar)ÚABCExtensionArrayÚABCIndexÚ    ABCSeries)ÚisnaÚnotna)Ú    roperator)Ú expressions)Úensure_wrapped_if_datetimelike)Úmissing)Úshould_extension_dispatch)Úinvalid_comparison)Ú    ArrayLikeÚShapecóä—|kt|«}t|«}||z }|j«r|j«}||||z<|j«r|j«}||||z<||fS)a®
    If a non-None fill_value is given, replace null entries in left and right
    with this value, but only in positions where _one_ of left/right is null,
    not both.
 
    Parameters
    ----------
    left : array-like
    right : array-like
    fill_value : object
 
    Returns
    -------
    left : array-like
    right : array-like
 
    Notes
    -----
    Makes copies if fill_value is not None and NAs are present.
    )rÚanyÚcopy)ÚleftÚrightÚ
fill_valueÚ    left_maskÚ
right_maskÚmasks      úLH:\Change_password\venv_build\Lib\site-packages\pandas/core/ops/array_ops.pyÚ
fill_binopr0Hsy€ð*Ðܘ“Jˆ    Ü˜%“[ˆ
ð˜:Ñ%ˆà =‰=Œ?à—9‘9“;ˆDØ%/ˆD˜TÑ!Ñ "à >‰>Ô à—J‘J“LˆEØ'1ˆE*˜tÑ#Ñ $à ˆ;ÐócóŠ—t|t«r t|«}t|tjt
t f«rÄt|j«s|jtj«}t|t
t f«r |j}|j|jk7r!td|j|j«‚tj|j!«|j!«|«}n%tj"|j!«||«}|j%|j«S)NzShapes must match)Ú
isinstanceÚlistrÚnpÚndarrayrrrÚdtypeÚastypeÚobject_Ú_valuesÚshapeÚ
ValueErrorÚlibopsÚ vec_compareÚravelÚscalar_compareÚreshape)ÚopÚxÚyÚresults    r/Úcomp_method_OBJECT_ARRAYrFqsրܐ!”TÔä 3°AÓ 6ˆä!”b—j‘j¤)¬XÐ6Ô7ܘqŸw™wÔ'Ø—‘œŸ™Ó$ˆAä aœ)¤XÐ.Ô /Ø—    ‘    ˆAà 7‰7a—g‘gÒ ÜÐ0°!·'±'¸1¿7¹7ÓCÐ CÜ×#Ñ# A§G¡G£I¨q¯w©w«y¸"Ó=‰ä×&Ñ& q§w¡w£y°!°RÓ8ˆØ >‰>˜!Ÿ'™'Ó "Ð"r1có—|j«}t|tj«rÓt    |j
|j
g«}tj |j|¬«}t|«t|«k7r t|j|j«‚t|«}|j«}t|«|j«z}|j«rÙ|||||«||<nÆt|«stdt|«›«‚tj |j|j
¬«}t|«}|t urtj"|dk(d|«}n,|t$j&urtj"|dk(d|«}|j«r||||«||<tj(||tj*«|j-|j«}|S)zé
    If the given arithmetic operation fails, attempt it again on
    only the non-null elements of the input array(s).
 
    Parameters
    ----------
    x : np.ndarray
    y : np.ndarray, Series, Index
    op : binary operator
    ©r7z1Cannot broadcast np.ndarray with operand of type éF)r?r3r5r6rr7ÚemptyÚsizeÚlenr<r;rr'rÚ    TypeErrorÚtypeÚpowÚwhererÚrpowÚputmaskÚnanrA)    rCrDrBÚxravr7rEÚymaskÚyravr.s             r/Ú_masked_arith_oprW…sŒ€ð 7‰7‹9€Dä!”R—Z‘ZÔ Ü  !§'¡'¨1¯7©7Ð!3Ó4ˆÜ—‘˜!Ÿ&™&¨Ô.ˆä ˆq‹6”S˜“VÒ Ü˜QŸW™W a§g¡gÓ.Ð .ܐa“ˆðw‰w‹yˆÜT‹{˜UŸ[™[›]Ñ*ˆð 8‰8Œ:Ù˜d 4™j¨$¨t©*Ó5ˆF4ŠLô˜Œ|ÜØCÄTÈ!ÃWÀ;ÐOóð ô
—‘˜!Ÿ&™&¨¯©Ô0ˆÜT‹{ˆð ”‰9Ü—8‘8˜A ™F E¨4Ó0‰DØ ”9—>‘>Ñ !Ü—8‘8˜A ™F E¨4Ó0ˆDà 8‰8Œ:Ù˜d 4™j¨!Ó,ˆF4‰Lä‡JJˆv˜uœbŸf™fÔ%Ø ^‰^˜AŸG™GÓ $€FØ €Mr1cór—t|t«r|}nttj|«}    |||«}|r t|«s|tur t|||«Stj||||«S#t
$r;|s5|j tk(st|dd«tk(rt|||«}n‚YŒ}wxYw)aÇ
    Return the result of evaluating op on the passed in values.
 
    If native types are not compatible, try coercion to object dtype.
 
    Parameters
    ----------
    left : np.ndarray
    right : np.ndarray or scalar
        Excludes DataFrame, Series, Index, ExtensionArray.
    is_cmp : bool, default False
        If this a comparison operation.
 
    Returns
    -------
    array-like
 
    Raises
    ------
    TypeError : invalid operation
    r7N)r3ÚstrrrÚevaluaterMr7ÚobjectÚgetattrrWrÚNotImplementedr#r!Údispatch_fill_zeros)r)r*rBÚis_cmpÚfuncrEs      r/Ú_na_arithmetic_opra½s¹€ô,%œÔà‰ä”{×+Ñ+¨RÓ0ˆð ِd˜EÓ"ˆñ”9˜VÔ$¨´.Ñ(@ô" $¨¨rÓ2Ð2ä × &Ñ & r¨4°¸Ó ?Ð?øô% ò
ÙØ J‰Jœ&Ò  ¤G¨E°7¸DÓ$AÄVÒ$Kô & d¨E°2Ó6‰Fà ñ ð
ús¯    A2Á2AB6Â5B6có®—t||«s#t|tttf«s|t
ur |||«}|St |||«t|||«}|S)aO
    Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ...
 
    Note: the caller is responsible for ensuring that numpy warnings are
    suppressed (with np.errstate(all="ignore")) if needed.
 
    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame or Index.  Series is *not* excluded.
    op : {operator.add, operator.sub, ...}
        Or one of the reversed variants from roperator.
 
    Returns
    -------
    ndarray or ExtensionArray
        Or a 2-tuple of these in the case of divmod or rdivmod.
    )r"r3rr r    rÚ_bool_arith_checkra)r)r*rBÚ
res_valuess    r/Ú arithmetic_opreðs_€ô6    " $¨Ô.Ü eœi¬´YÐ?Ô @Ø ”C‰<ñ˜˜e“_ˆ
ð Ðô     ˜"˜d EÔ*ô' t¨U°BÓ7ˆ
à Ðr1có—t|«}t|«}tj|«}t|t«rt j |«}t|t
jtf«r8t|«t|«k7r!td|j|j«‚t||«s6t|tttf«s|t ur|j"t$k7r |||«}|St'|«rkt)|«r`|t*j,ur't j.|jt0¬«}|St j2|jt0¬«}|St5||«r t7|||«S|j"t$k(st|t8«rt;|||«}|St=|||d¬«}|S)aì
    Evaluate a comparison operation `=`, `!=`, `>=`, `>`, `<=`, or `<`.
 
    Note: the caller is responsible for ensuring that numpy warnings are
    suppressed (with np.errstate(all="ignore")) if needed.
 
    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame, Series, or Index.
    op : {operator.eq, operator.ne, operator.gt, operator.ge, operator.lt, operator.le}
 
    Returns
    -------
    ndarray or ExtensionArray
    zLengths must match to comparerHT)r_)r r
Úitem_from_zerodimr3r4r5Úasarrayr6rrLr<r;r"rr r    rr7r[rrÚoperatorÚneÚonesÚboolÚzerosrr#rYrFra)r)r*rBÚlvaluesÚrvaluesrds      r/Ú comparison_oprp s}€ô&-¨TÓ2€GÜ,¨UÓ3€Gä×#Ñ# GÓ,€Gܐ'œ4Ô ô—*‘*˜WÓ%ˆä'œBŸJ™JÔ(9Ð:Ô;ô ˆw‹<œ3˜w›<Ò 'ÜØ/°·±ÀÇ Á óð ô! ¨'Ô2Ü    Gœi¬´YÐ?Ô    @ÀEÌSÁLØ M‰MœVÒ #ñ˜ Ó)ˆ
ð& Ðô#
7Ô    ¤ W¤ à ”—‘Ñ ÜŸ™ §¡´dÔ;ˆJð ÐôŸ™ '§-¡-´tÔ<ˆJð Ðô
" '¨7Ô    3ä! '¨7°BÓ7Ð7à    ‰œ&Ò     ¤J¨w¼Ô$<Ü-¨b°'¸7ÓCˆ
ð
Ðô' w°¸ÀDÔIˆ
à Ðr1c óô—    |||«}|j+|j,«S#t$rGt|tj«r~|jj
dk(r|jj
dk(rJ‚t |«}t |«}tj|j«|j«|«}n«tj|«sJ‚t|«s t|«}    tj|||«}ne#ttt t"t$f$rD}t'|«j(}td|j(›d|j›d|›d«|‚d}~wwxYwYŒkwxYw)NÚbzCannot perform 'z' with a dtyped [z] array and scalar of type [ú])rMr3r5r6r7Úkindrr=Ú    vec_binopr?r
rrrlÚ scalar_binopr<ÚAttributeErrorÚ OverflowErrorÚNotImplementedErrorrNÚ__name__rAr;)rCrDrBrEÚerrÚtyps      r/Ú na_logical_opr}`sJ€ð#ñAq“ˆð8 >‰>˜!Ÿ'™'Ó "Ð"øô7 óÜ aœŸ™Ô $àŸ™Ÿ ™ ¨Ò+°·±· ± ÀÒ0CÐ DÐDܘaÓ ˆAܘaÓ ˆAÜ×%Ñ% a§g¡g£i°·±³¸BÓ?‰Fô—=‘= Ô#Ð #Ð#ܘ”7ܘ“Gð Ü×,Ñ,¨Q°°2Ó6‘øäÜÜÜÜ#ð ò ô˜1“g×&Ñ&ÜØ& r§{¡{ mÐ3DÀQÇWÁWÀIðN+Ø+.¨%¨qð2óððûð ýðús4‚    &¦CE7Ã6DÄ E7ÄE0Ä,?E+Å+E0Å0E7Å6E7có—dd„}tj|«}t|«r;t|d«s/t    j
dt t«¬«t|«}t|«}|}t||«r |||«}|St|tj«r$|jjdv}|s|||«}ntj |«}t#|||«}|jjdvr|s||«}|S)ag
    Evaluate a logical operation `|`, `&`, or `^`.
 
    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame, Series, or Index.
    op : {operator.and_, operator.or_, operator.xor}
        Or one of the reversed variants from roperator.
 
    Returns
    -------
    ndarray or ExtensionArray
    có—|jjdvr5t|«}|j«r|j    t
«}d||<||jjdk(r|j    t «}|S)NÚcfOFrr)r7rtrr'r8r[rl)rCr)r.s   r/Ú    fill_boolzlogical_op.<locals>.fill_boolšsa€à 7‰7<‰<˜5Ñ  ä˜“7ˆD؏x‰xŒzØ—H‘HœVÓ$Ø$‘à ˆ<˜4Ÿ:™:Ÿ?™?¨cÒ1Ø—‘œ“ˆA؈r1r7zÚLogical ops (and, or, xor) between Pandas objects and dtype-less sequences (e.g. list, tuple) are deprecated and will raise in a future version. Wrap the object in a Series, Index, or np.array before operating instead.)Ú
stacklevelÚiu)N)r
rgrÚhasattrÚwarningsÚwarnÚ FutureWarningrrr r"r3r5r6r7rtÚ
is_integerr})r)r*rBrrnrordÚis_other_int_dtypes        r/Ú
logical_oprЉsù€ó" ô × !Ñ ! %Ó (€EܐEÔ¤7¨5°'Ô#:ä ‰ ð (ô Ü'Ó)õ     
ô8¸Ó>ˆô-¨TÓ2€GØ€Gä  ¨'Ô2ᘠÓ)ˆ
ð& Ðô! gœrŸz™zÔ *Ø!(§¡×!3Ñ!3°tÐ!;Ð Ù%Ù# G¨WÓ5‘ô"%§¡°Ó!8Ð ä" 7¨G°RÓ8ˆ
ð—
‘
—‘ 4Ñ'Ñ,>Ù" :Ó.ˆJà Ðr1có—t|t«r|S|jjd«j    d«}|dk(r|S|dvrtt
|¬«S|dvrtt |¬«S|dvrtt|¬«St|«‚)zì
    Return a binary array operation corresponding to the given operator op.
 
    Parameters
    ----------
    op : function
        Binary operator from operator or roperator module.
 
    Returns
    -------
    functools.partial
    Ú_ÚrÚarith_op>ÚeqÚgeÚgtÚleÚltrj)rB>ÚorÚandÚrorÚxorÚrandÚrxor>ÚaddÚmodÚmulrOÚsubÚdivmodÚtruedivÚfloordiv)    r3rrzÚstripÚlstriprprŠrery)rBÚop_names  r/Ú get_array_opr¤Ðs–€ô"”gÔðˆ    àk‰k×Ñ Ó$×+Ñ+¨CÓ0€Gؐ*Òðˆ    àÐ6Ñ6Ü”}¨Ô,Ð,Ø    Ð?Ñ    ?Ü”z bÔ)Ð)Ø    ð    ñ    
ô”}¨Ô,Ð,ä! 'Ó*Ð*r1có^—t|«tjur t|«St|«tjur t    |«St |t j«r±t|«r›ddl    m
}t|j«r|jd«}n;t|j«s&t|j«}|j|«}t j ||«}|j#||j¬«St    |«St |t j$«r±t|«r›ddl    m}t|j«r|jd«}n;t|j«s&t|j«}|j|«}t j ||«}|j#||j¬«St|«St |t j(«r t+|«St |t j,«r t/|«S|S)ax
    Cast non-pandas objects to pandas types to unify behavior of arithmetic
    and comparison operations.
 
    Parameters
    ----------
    obj: object
    shape : tuple[int]
 
    Returns
    -------
    out : object
 
    Notes
    -----
    Be careful to call this *after* determining the `name` attribute to be
    attached to the result of the arithmetic operation.
    r)Ú DatetimeArrayzdatetime64[ns]rH)ÚTimedeltaArrayztimedelta64[ns])rNÚdatetimeÚ    timedeltarr    r3r5Ú
datetime64rÚpandas.core.arraysr¦rr7r8rr Ú broadcast_toÚ _simple_newÚ timedelta64r§ÚintegerÚintÚfloatingÚfloat)Úobjr;r¦Ú    new_dtyper*r§s      r/Úmaybe_prepare_scalar_for_oprµûsš€ô& ˆCƒy”H×&Ñ&Ñ&ô˜‹~ÐÜ     ˆc‹”h×'Ñ'Ñ    '䘋~ÐÜ    CœŸ™Ô    'ô Œ9Ý 8ô˜3Ÿ9™9Ô%Ø—j‘jÐ!1Ó2‘Ü'¨¯    ©    Ô2Ü/°·    ±    Ó:    Ø—j‘j Ó+Ü—O‘O C¨Ó/ˆEØ ×,Ñ,¨U¸%¿+¹+Ð,ÓFÐ F䘋~Ðä    CœŸ™Ô    (Ü Œ9Ý 9ô ˜3Ÿ9™9Ô%Ø—j‘jÐ!2Ó3‘Ü'¨¯    ©    Ô2Ü/°·    ±    Ó:    Ø—j‘j Ó+Ü—O‘O C¨Ó/ˆEØ!×-Ñ-¨e¸5¿;¹;Ð-ÓGÐ Gô
˜‹~Ðô
CœŸ™Ô    $ܐ3‹xˆä    CœŸ™Ô    %ܐS‹zÐà €Jr1cóü—|tvrt|jjdk(rZt|«st    j
|«r9|j jd«jd«}td|›d«‚yyy)z`
    In contrast to numpy, pandas raises an error for certain operations
    with booleans.
    rrrŒrz
operator 'z!' not implemented for bool dtypesN)
Ú_BOOL_OP_NOT_ALLOWEDr7rtrr
Úis_boolrzr¡r¢ry)rBÚarrr£s    r/rcrcRsu€ð
 
Ô !Ñ!Ø 7‰7<‰<˜3Ò ¤M°!Ô$4¼¿ ¹ ÀA¼Ø—k‘k×'Ñ'¨Ó,×3Ñ3°CÓ8ˆGÜ%ؘW˜IÐ%FÐGóð ð9GÐ ð"r1)rCú
np.ndarray)F)r)rºr_rl)r)r$r*r)r)r$r*rÚreturnr$)r;r%)r¹rº)MÚ__doc__Ú
__future__rr¨Ú    functoolsrriÚtypingrrr…Únumpyr5Ú pandas._libsrrr    r
r r=Úpandas._libs.tslibsr r rrÚpandas.util._exceptionsrÚpandas.core.dtypes.castrrÚpandas.core.dtypes.commonrrrrrrÚpandas.core.dtypes.genericrrrÚpandas.core.dtypes.missingrrÚ pandas.corerÚpandas.core.computationrÚpandas.core.constructionr Úpandas.core.opsr!Úpandas.core.ops.dispatchr"Úpandas.core.ops.invalidr#Úpandas._typingr$r%r0rFrWrarerpr}rŠr¤rµrŸÚrtruedivr Ú    rfloordivrOrQr·rc©r1r/ú<module>rÒs÷ðñõ#ãÝÛ÷óã÷õ÷óõ 5÷÷÷÷ñ÷
õ
"Ý/ÝCÝ#Ý>Ý6á÷ò&òR#ó(5ôp0@óf-ó`=ó@&#óRDòN(+óVJð\ ×ÑØ ×ÑØ ×ÑØ ×ÑØ ‡LLØ ‡NNð Ðô
r1