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
U
¬ý°dÛã@sšdZddlmZddlmZddlZddlmZddlm    Z    ddl
m Z ddl m Z dd    lmZmZmZd
d d œd d„Zd
dœdd„Zdd„Zdd„ZdS)z;
Boilerplate functions used in defining binary operations.
é)Ú annotations)ÚwrapsN)ÚCallable)Úitem_from_zerodim)Úis_matching_na)ÚF)Ú ABCDataFrameÚABCIndexÚ    ABCSeriesÚstrzCallable[[F], F])ÚnameÚreturncsdddœ‡fdd„ }|S)z§
    Boilerplate for pandas conventions in arithmetic and comparison methods.
 
    Parameters
    ----------
    name : str
 
    Returns
    -------
    decorator
    r)Úmethodr cs
t|ˆƒS©N)Ú_unpack_zerodim_and_defer)r©r ©úMd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/ops/common.pyÚwrapper"sz)unpack_zerodim_and_defer.<locals>.wrapperr)r rrrrÚunpack_zerodim_and_defers rrcs^tjdkr,ddlm}m}|||dƒdƒ}n| d¡ d¡}|dk‰tˆƒ‡‡fdd„ƒ}|S)aM
    Boilerplate for pandas conventions in arithmetic and comparison methods.
 
    Ensure method returns NotImplemented when operating against "senior"
    classes.  Ensure zero-dimensional ndarrays are always unpacked.
 
    Parameters
    ----------
    method : binary method
    name : str
 
    Returns
    -------
    method
    )éé    r)Ú removeprefixÚ removesuffixÚ__>ÚleÚltÚneÚgeÚgtÚeqcs\ˆrt|tƒrt|tƒrn0tttfD]$}t||ƒr6qJt||ƒr$tSq$t|ƒ}ˆ||ƒSr)Ú
isinstancer    r
rÚNotImplementedr)ÚselfÚotherÚcls©Zis_cmprrrÚ
new_methodCs
 
 
z-_unpack_zerodim_and_defer.<locals>.new_method)ÚsysÚ version_infoZpandas.util._str_methodsrrr)rr rrZ stripped_namer'rr&rr(s
rcCs$t|ttfƒrt||ƒ}n|j}|S)a
    Find the appropriate name to pin to an operation result.  This result
    should always be either an Index or a Series.
 
    Parameters
    ----------
    left : {Series, Index}
    right : object
 
    Returns
    -------
    name : object
        Usually a string
    )r!r
r    Ú_maybe_match_namer )ÚleftÚrightr rrrÚget_op_result_nameVs r-cCs®t|dƒ}t|dƒ}|r–|r–z4|j|jkr2|jWSt|j|jƒrH|jWSWdSWqªtk
r~t|j|jƒrx|jYSYdStk
r’YdSXn|r |jS|rª|jSdS)a«
    Try to find a name to attach to the result of an operation between
    a and b.  If only one of these has a `name` attribute, return that
    name.  Otherwise return a consensus name if they match or None if
    they have different names.
 
    Parameters
    ----------
    a : object
    b : object
 
    Returns
    -------
    name : str or None
 
    See Also
    --------
    pandas.core.common.consensus_name_attr
    r N)Úhasattrr rÚ    TypeErrorÚ
ValueError)ÚaÚbZa_hasZb_hasrrrr*ls(
 
 
 
 
r*)Ú__doc__Ú
__future__rÚ    functoolsrr(ÚtypingrZpandas._libs.librZpandas._libs.missingrZpandas._typingrZpandas.core.dtypes.genericrr    r
rrr-r*rrrrÚ<module>s      .