hyb
2025-12-23 10f3a1daddfbc7fa3dd2069197d83e8b6ef19176
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
Ë
nñúh<'ãó,—dZddlmZddlmZmZddlZddlmZddl    m
Z
Gd„d«Z Gd    „d
«Z d d „d f                                    dd„Z Gd„d«Zedd¬«dd„«Zeed¬«dd„«Zeed¬«dd„«Zeed¬«dd„«Zy)z†
 
accessor.py contains base classes for implementing accessor properties
that can be mixed into or pinned onto other pandas classes.
 
é)Ú annotations)ÚCallableÚfinalN)Údoc)Úfind_stack_levelcól‡—eZdZUe«Zded<e«Zded<edd„«Z    dd„Z
d    ˆfd„ Z ˆxZ S)
Ú DirNamesMixinúset[str]Ú
_accessorszfrozenset[str]Ú _hidden_attrscó4—|j|jzS)z:
        Delete unwanted __dir__ for this object.
        )r r )Úselfs úGH:\Change_password\venv_build\Lib\site-packages\pandas/core/accessor.pyÚ_dir_deletionszDirNamesMixin._dir_deletionss€ð
‰ ×!3Ñ!3Ñ3Ð3ócóZ—|jDchc]}t||«sŒ|’Œc}Scc}w)z9
        Add additional __dir__ for this object.
        )r Úhasattr)rÚaccessors  rÚ_dir_additionszDirNamesMixin._dir_additionss%€ð*.¯©ÖT˜X¼GÀDÈ(Õ<S’ÒTÐTùÒTs(¡(c󐕗tt‰|    ««}||j«z
|j    «z}t |«S)z€
        Provide method name lookup and completion.
 
        Notes
        -----
        Only provide 'public' methods.
        )ÚsetÚsuperÚ__dir__rrÚsorted)rÚrvÚ    __class__s  €rrzDirNamesMixin.__dir__$sAø€ô”‘‘Ó"Ó #ˆØ4×&Ñ&Ó(Ñ(¨D×,?Ñ,?Ó,AÑ AˆÜb‹zÐr)Úreturnr
)rú    list[str]) Ú__name__Ú
__module__Ú __qualname__rr Ú__annotations__Ú    frozensetr rrrrÚ __classcell__)rs@rr    r    s=ø…Ù›5€JÓ Ù$-£K€M>Ó/à
ò4ó ð4ó U÷
ñ
rr    cóZ—eZdZdZd
d„Zd
d„Zd
d„Zedd„df                                            d d„«Zy    ) ÚPandasDelegatez@
    Abstract base class for delegating methods/properties.
    có—td|›«‚)NzYou cannot access the property ©Ú    TypeError©rÚnameÚargsÚkwargss    rÚ_delegate_property_getz%PandasDelegate._delegate_property_get6s€ÜÐ9¸$¸Ð@ÓAÐArcó —td|›d«‚)Nz The property z cannot be setr()rr+Úvaluer,r-s     rÚ_delegate_property_setz%PandasDelegate._delegate_property_set9s€Ü˜-¨ v¨^Ð<Ó=Ð=rcó—td|›«‚)NzYou cannot call method r(r*s    rÚ_delegate_methodzPandasDelegate._delegate_method<s€ÜÐ1°$°Ð8Ó9Ð9rFcó—|S©N©©Úxs rú<lambda>zPandasDelegate.<lambda>Fs€¸1€rTc󇇗dˆˆfd„ }dˆˆfd„ }|D]J}    |st‰‰|    «d«€Œ|dk(r    ||    «}
n||    «}
|s t||    «rŒ>t||    |
«ŒLy)aí
        Add accessors to cls from the delegate class.
 
        Parameters
        ----------
        cls
            Class to add the methods/properties to.
        delegate
            Class to get methods/properties and doc-strings.
        accessors : list of str
            List of accessors to add.
        typ : {'property', 'method'}
        overwrite : bool, default False
            Overwrite the method/property in the target class if it exists.
        accessor_mapping: Callable, default lambda x: x
            Callable to map the delegate's function to the cls' function.
        raise_on_missing: bool, default True
            Raise if an accessor does not exist on delegate.
            False skips the missing accessor.
        c
󆕇—ˆfd„}ˆfd„}‰|_‰|_t||t‰‰‰««j¬«S)Ncó&•—|j‰«Sr5)r.)rr+s €rÚ_getterz[PandasDelegate._add_delegate_accessors.<locals>._create_delegator_property.<locals>._getter_sø€Ø×2Ñ2°4Ó8Ð8rcó(•—|j‰|«Sr5)r1)rÚ
new_valuesr+s  €rÚ_setterz[PandasDelegate._add_delegate_accessors.<locals>._create_delegator_property.<locals>._setterbsø€Ø×2Ñ2°4¸ÓDÐDr)ÚfgetÚfsetr)rÚpropertyÚgetattrÚ__doc__)r+r=r@Úaccessor_mappingÚdelegates`  €€rÚ_create_delegator_propertyzJPandasDelegate._add_delegate_accessors.<locals>._create_delegator_property^sIù€ô 9ô Eð $ˆGÔ Ø#ˆGÔ äØØÜ˜HÑ&6°tÓ&<Ó=×EÑEôð rcód•‡—ˆfd„}‰|_t‰‰‰««j|_|S)Ncó0•—|j‰g|¢­i|¤ŽSr5)r3)rr,r-r+s   €rÚfzSPandasDelegate._add_delegate_accessors.<locals>._create_delegator_method.<locals>.fos ø€Ø,t×,Ñ,¨TÐC°DÒC¸FÑCÐCr)rrDrE)r+rKrFrGs` €€rÚ_create_delegator_methodzHPandasDelegate._add_delegate_accessors.<locals>._create_delegator_methodns1ù€ô DðˆAŒJÜ Ñ*:¸4Ó*@ÓA×IÑIˆAŒIàˆHrNrC©r+Ústr)rDrÚsetattr) ÚclsrGÚ    accessorsÚtypÚ    overwriterFÚraise_on_missingrHrLr+rKs  `   `     rÚ_add_delegate_accessorsz&PandasDelegate._add_delegate_accessors?soù€ö>    ö     ðò    &ˆDá$ܘHÑ&6°tÓ&<¸dÓCÐKààjÒ Ù.¨tÓ4‘á,¨TÓ2ñ¤¨¨TÕ 2ܘ˜T 1Õ%ñ    &rNrM) rQrrRrNrSÚboolrFúCallable[[str], str]rTrVrÚNone)    rr r!rEr.r1r3Ú classmethodrUr6rrr&r&1sz„ñóBó>ó:ðð  Ù1<Ø!%ðE&ððE&ðð    E&ð
ð E&ð /ð E&ððE&ð
òE&óñE&rr&Fcó—|Sr5r6r7s rr9r9s€°q€rTcó&‡‡‡‡‡‡—ˆˆˆˆˆˆfd„}|S)a×
    Add delegated names to a class using a class decorator.  This provides
    an alternative usage to directly calling `_add_delegate_accessors`
    below a class definition.
 
    Parameters
    ----------
    delegate : object
        The class to get methods/properties & doc-strings.
    accessors : Sequence[str]
        List of accessor to add.
    typ : {'property', 'method'}
    overwrite : bool, default False
       Overwrite the method/property in the target class if it exists.
    accessor_mapping: Callable, default lambda x: x
        Callable to map the delegate's function to the cls' function.
    raise_on_missing: bool, default True
        Raise if an accessor does not exist on delegate.
        False skips the missing accessor.
 
    Returns
    -------
    callable
        A class decorator.
 
    Examples
    --------
    @delegate_names(Categorical, ["categories", "ordered"], "property")
    class CategoricalAccessor(PandasDelegate):
        [...]
    có6•—|j‰‰‰‰‰‰¬«|S)N)rSrFrT)rU)rPrFrQrGrSrTrRs €€€€€€rÚadd_delegate_accessorsz.delegate_names.<locals>.add_delegate_accessors°s/ø€Ø ×#Ñ#Ø Ø Ø ØØ-Ø-ð     $ô    
ðˆ
rr6)rGrQrRrSrFrTr]s`````` rÚdelegate_namesr^ˆsý€÷P    ñ    ð "Ð!rcó—eZdZdZdd„Zd„Zy)ÚCachedAccessora¡
    Custom property-like object.
 
    A descriptor for caching accessors.
 
    Parameters
    ----------
    name : str
        Namespace that will be accessed under, e.g. ``df.foo``.
    accessor : cls
        Class with the extension methods.
 
    Notes
    -----
    For accessor, The class's __init__ method assumes that one of
    ``Series``, ``DataFrame`` or ``Index`` as the
    single argument ``data``.
    có —||_||_yr5)Ú_nameÚ    _accessor)rr+rs   rÚ__init__zCachedAccessor.__init__Øs€ØˆŒ
Ø!ˆrcó†—|€ |jS|j|«}tj||j|«|Sr5)rcÚobjectÚ __setattr__rb)rÚobjrPÚ accessor_objs    rÚ__get__zCachedAccessor.__get__Üs=€Ø ˆ;à—>‘>Ð !Ø—~‘~ cÓ*ˆ ô
    ×ј3 §
¡
¨LÔ9ØÐrN)r+rNrrX)rr r!rErdrjr6rrr`r`Äs„ñó&"ó
rr`Ú)ÚklassÚothersc󇇗ˆˆfd„}|S)aG
    Register a custom accessor on {klass} objects.
 
    Parameters
    ----------
    name : str
        Name under which the accessor should be registered. A warning is issued
        if this name conflicts with a preexisting attribute.
 
    Returns
    -------
    callable
        A class decorator.
 
    See Also
    --------
    register_dataframe_accessor : Register a custom accessor on DataFrame objects.
    register_series_accessor : Register a custom accessor on Series objects.
    register_index_accessor : Register a custom accessor on Index objects.
 
    Notes
    -----
    When accessed, your accessor will be initialized with the pandas object
    the user is interacting with. So the signature must be
 
    .. code-block:: python
 
        def __init__(self, pandas_object):  # noqa: E999
            ...
 
    For consistency with pandas methods, you should raise an ``AttributeError``
    if the data passed to your accessor has an incorrect dtype.
 
    >>> pd.Series(['a', 'b']).dt
    Traceback (most recent call last):
    ...
    AttributeError: Can only use .dt accessor with datetimelike values
 
    Examples
    --------
    In your library code::
 
        import pandas as pd
 
        @pd.api.extensions.register_dataframe_accessor("geo")
        class GeoAccessor:
            def __init__(self, pandas_obj):
                self._obj = pandas_obj
 
            @property
            def center(self):
                # return the geographic center point of this DataFrame
                lat = self._obj.latitude
                lon = self._obj.longitude
                return (float(lon.mean()), float(lat.mean()))
 
            def plot(self):
                # plot this array's data on a map, e.g., using Cartopy
                pass
 
    Back in an interactive IPython session:
 
        .. code-block:: ipython
 
            In [1]: ds = pd.DataFrame({{"longitude": np.linspace(0, 10),
               ...:                    "latitude": np.linspace(0, 20)}})
            In [2]: ds.geo.center
            Out[2]: (5.0, 10.0)
            In [3]: ds.geo.plot()  # plots data on a map
    c
ó•—t‰‰«rItjdt|«›dt‰«›dt‰«›dtt «¬«t ‰‰t‰|««‰jj‰«|S)Nzregistration of accessor z  under name z
 for type z: is overriding a preexisting attribute with the same name.)Ú
stacklevel)
rÚwarningsÚwarnÚreprÚ UserWarningrrOr`r Úadd)rrPr+s €€rÚ    decoratorz%_register_accessor.<locals>.decorator2s{ø€Ü 3˜Ô Ü M‰MØ+¬D°«NÐ+;¸<ܘ“:,˜j¬¨c«¨ ð40ð1ôÜ+Ó-õ  ô    Tœ>¨$°Ó9Ô:Ø ‰×ј4Ԡ؈rr6)r+rPrvs`` rÚ_register_accessorrwésù€õR ð ÐrÚ    DataFrame)rlcó&—ddlm}t||«S)Nr)rx)Úpandasrxrw)r+rxs  rÚregister_dataframe_accessorr{Bs€å ä ˜d IÓ .Ð.rÚSeriescó&—ddlm}t||«S)Nr)r|)rzr|rw)r+r|s  rÚregister_series_accessorr~Is€åä ˜d FÓ +Ð+rÚIndexcó&—ddlm}t||«S)Nr)r)rzrrw)r+rs  rÚregister_index_accessorrPs€åä ˜d EÓ *Ð*r)
rQrrRrNrSrVrFrWrTrVrM)rEÚ
__future__rÚtypingrrrqÚpandas.util._decoratorsrÚpandas.util._exceptionsrr    r&r^r`rwr{r~rr6rrú<module>r†sôðñõ #÷óå'Ý4÷ñ÷<T&ñT&ðvÙ-8Ø!ð 3"àð3"ð
ð3"ðð    3"ð
+ð 3"ð ó 3"÷x"ñ"ñJˆ2bÔòUóðUñpИ{Ô+ò/ó,ð/ñ ИxÔ(ò,ó)ð,ñ ИwÔ'ò+ó(ñ+r