
    A>iE                        S r SSKJr  SSKrSSKJr  SSKrSSKJ	r	  SSK
Jr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSSSS.r " S S5      rSS jrSS jrSS jrSS jrSS jrSS jrg)zn
Methods that can be shared by many array-like classes or subclasses:
    Series
    Index
    ExtensionArray
    )annotationsN)Any)lib)!maybe_dispatch_ufunc_to_dunder_op)maybe_unbox_numpy_scalar)
ABCNDFrame)	roperatorextract_array)unpack_zerodim_and_defermaxminsumprod)maximumminimumaddmultiplyc                  6   \ rS rSrS r\" S5      S 5       r\" S5      S 5       r\" S5      S 5       r\" S	5      S
 5       r	\" S5      S 5       r
\" S5      S 5       rS r\" S5      S 5       r\" S5      S 5       r\" S5      S 5       r\" S5      S 5       r\" S5      S 5       r\" S5      S 5       rS r\" S5      S 5       r\" S5      S  5       r\" S!5      S" 5       r\" S#5      S$ 5       r\" S%5      S& 5       r\" S'5      S( 5       r\" S)5      S* 5       r\" S+5      S, 5       r\" S-5      S. 5       r\" S/5      S0 5       r\" S15      S2 5       r\" S35      S4 5       r\" S55      S6 5       r \" S75      S8 5       r!\" S95      S: 5       r"\" S;5      S< 5       r#S=r$g>)?OpsMixin!   c                    [         $ NNotImplementedselfotherops      T/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/core/arraylike.py_cmp_methodOpsMixin._cmp_method%           __eq__c                B    U R                  U[        R                  5      $ r   )r!   operatoreqr   r   s     r    r%   OpsMixin.__eq__(       x{{33r$   __ne__c                B    U R                  U[        R                  5      $ r   )r!   r'   ner)   s     r    r,   OpsMixin.__ne__,   r+   r$   __lt__c                B    U R                  U[        R                  5      $ r   )r!   r'   ltr)   s     r    r0   OpsMixin.__lt__0   r+   r$   __le__c                B    U R                  U[        R                  5      $ r   )r!   r'   ler)   s     r    r4   OpsMixin.__le__4   r+   r$   __gt__c                B    U R                  U[        R                  5      $ r   )r!   r'   gtr)   s     r    r8   OpsMixin.__gt__8   r+   r$   __ge__c                B    U R                  U[        R                  5      $ r   )r!   r'   ger)   s     r    r<   OpsMixin.__ge__<   r+   r$   c                    [         $ r   r   r   s      r    _logical_methodOpsMixin._logical_methodC   r#   r$   __and__c                B    U R                  U[        R                  5      $ r   )rA   r'   and_r)   s     r    rC   OpsMixin.__and__F   s    ##E8==99r$   __rand__c                B    U R                  U[        R                  5      $ r   )rA   r	   rand_r)   s     r    rG   OpsMixin.__rand__J   s    ##E9??;;r$   __or__c                B    U R                  U[        R                  5      $ r   )rA   r'   or_r)   s     r    rK   OpsMixin.__or__N       ##E8<<88r$   __ror__c                B    U R                  U[        R                  5      $ r   )rA   r	   ror_r)   s     r    rP   OpsMixin.__ror__R       ##E9>>::r$   __xor__c                B    U R                  U[        R                  5      $ r   )rA   r'   xorr)   s     r    rU   OpsMixin.__xor__V   rO   r$   __rxor__c                B    U R                  U[        R                  5      $ r   )rA   r	   rxorr)   s     r    rY   OpsMixin.__rxor__Z   rT   r$   c                    [         $ r   r   r   s      r    _arith_methodOpsMixin._arith_methoda   r#   r$   __add__c                B    U R                  U[        R                  5      $ )a	  
Get Addition of DataFrame and other, column-wise.

Equivalent to ``DataFrame.add(other)``.

Parameters
----------
other : scalar, sequence, Series, dict or DataFrame
    Object to be added to the DataFrame.

Returns
-------
DataFrame
    The result of adding ``other`` to DataFrame.

See Also
--------
DataFrame.add : Add a DataFrame and another object, with option for index-
    or column-oriented addition.

Examples
--------
>>> df = pd.DataFrame(
...     {"height": [1.5, 2.6], "weight": [500, 800]}, index=["elk", "moose"]
... )
>>> df
       height  weight
elk       1.5     500
moose     2.6     800

Adding a scalar affects all rows and columns.

>>> df[["height", "weight"]] + 1.5
       height  weight
elk       3.0   501.5
moose     4.1   801.5

Each element of a list is added to a column of the DataFrame, in order.

>>> df[["height", "weight"]] + [0.5, 1.5]
       height  weight
elk       2.0   501.5
moose     3.1   801.5

Keys of a dictionary are aligned to the DataFrame, based on column names;
each value in the dictionary is added to the corresponding column.

>>> df[["height", "weight"]] + {"height": 0.5, "weight": 1.5}
       height  weight
elk       2.0   501.5
moose     3.1   801.5

When `other` is a :class:`Series`, the index of `other` is aligned with the
columns of the DataFrame.

>>> s1 = pd.Series([0.5, 1.5], index=["weight", "height"])
>>> df[["height", "weight"]] + s1
       height  weight
elk       3.0   500.5
moose     4.1   800.5

Even when the index of `other` is the same as the index of the DataFrame,
the :class:`Series` will not be reoriented. If index-wise alignment is desired,
:meth:`DataFrame.add` should be used with `axis='index'`.

>>> s2 = pd.Series([0.5, 1.5], index=["elk", "moose"])
>>> df[["height", "weight"]] + s2
       elk  height  moose  weight
elk    NaN     NaN    NaN     NaN
moose  NaN     NaN    NaN     NaN

>>> df[["height", "weight"]].add(s2, axis="index")
       height  weight
elk       2.0   500.5
moose     4.1   801.5

When `other` is a :class:`DataFrame`, both columns names and the
index are aligned.

>>> other = pd.DataFrame(
...     {"height": [0.2, 0.4, 0.6]}, index=["elk", "moose", "deer"]
... )
>>> df[["height", "weight"]] + other
       height  weight
deer      NaN     NaN
elk       1.7     NaN
moose     3.0     NaN
)r^   r'   r   r)   s     r    r`   OpsMixin.__add__d   s    t !!%66r$   __radd__c                B    U R                  U[        R                  5      $ r   )r^   r	   raddr)   s     r    rc   OpsMixin.__radd__       !!%88r$   __sub__c                B    U R                  U[        R                  5      $ r   )r^   r'   subr)   s     r    rh   OpsMixin.__sub__       !!%66r$   __rsub__c                B    U R                  U[        R                  5      $ r   )r^   r	   rsubr)   s     r    rm   OpsMixin.__rsub__   rg   r$   __mul__c                B    U R                  U[        R                  5      $ r   )r^   r'   mulr)   s     r    rq   OpsMixin.__mul__   rl   r$   __rmul__c                B    U R                  U[        R                  5      $ r   )r^   r	   rmulr)   s     r    ru   OpsMixin.__rmul__   rg   r$   __truediv__c                B    U R                  U[        R                  5      $ r   )r^   r'   truedivr)   s     r    ry   OpsMixin.__truediv__   s    !!%)9)9::r$   __rtruediv__c                B    U R                  U[        R                  5      $ r   )r^   r	   rtruedivr)   s     r    r}   OpsMixin.__rtruediv__   s    !!%););<<r$   __floordiv__c                B    U R                  U[        R                  5      $ r   )r^   r'   floordivr)   s     r    r   OpsMixin.__floordiv__   s    !!%):):;;r$   __rfloordivc                B    U R                  U[        R                  5      $ r   )r^   r	   	rfloordivr)   s     r    __rfloordiv__OpsMixin.__rfloordiv__   s    !!%)<)<==r$   __mod__c                B    U R                  U[        R                  5      $ r   )r^   r'   modr)   s     r    r   OpsMixin.__mod__   rl   r$   __rmod__c                B    U R                  U[        R                  5      $ r   )r^   r	   rmodr)   s     r    r   OpsMixin.__rmod__   rg   r$   
__divmod__c                .    U R                  U[        5      $ r   )r^   divmodr)   s     r    r   OpsMixin.__divmod__   s    !!%00r$   __rdivmod__c                B    U R                  U[        R                  5      $ r   )r^   r	   rdivmodr)   s     r    r   OpsMixin.__rdivmod__   s    !!%):):;;r$   __pow__c                B    U R                  U[        R                  5      $ r   )r^   r'   powr)   s     r    r   OpsMixin.__pow__   rl   r$   __rpow__c                B    U R                  U[        R                  5      $ r   )r^   r	   rpowr)   s     r    r   OpsMixin.__rpow__   rg   r$    N)%__name__
__module____qualname____firstlineno__r!   r   r%   r,   r0   r4   r8   r<   rA   rC   rG   rK   rP   rU   rY   r^   r`   rc   rh   rm   rq   ru   ry   r}   r   r   r   r   r   r   r   r   __static_attributes__r   r$   r    r   r   !   s    h'4 (4 h'4 (4 h'4 (4 h'4 (4 h'4 (4 h'4 (4 i(: ): j)< *< h'9 (9 i(; ); i(9 )9 j); *; i(Y7 )Y7v j)9 *9 i(7 )7 j)9 *9 i(7 )7 j)9 *9 m,; -; n-= .= n-< .< m,> -> i(7 )7 j)9 *9 l+1 ,1 m,< -< i(7 )7 j)9 *9r$   r   c           	       ^ ^^^^^^^^ SSK JnJn  SSKJm  SSKJm  [        T 5      n[        S0 UD6n[        T TT/UQ70 UD6nU[        La  U$ [        R                  R                  UR                  4n	U H  n
[        U
S5      =(       a    U
R                  T R                  :  n[        U
S5      =(       a:    [        U
5      R                  U	;  =(       a    [!        U
T R"                  5      (       + nU(       d	  U(       d  M  [        s  $    [%        S U 5       5      n['        X=SS	9 VVs/ s H  u  p[)        UT5      (       d  M  UPM     snnm[+        T5      S
:  a  [-        U5      n[+        U5      S
:  a&  XV1R/                  U5      (       a  [1        ST S35      eT R2                  nTS
S  HB  n[5        ['        UUR2                  SS	95       H  u  nu  nnUR7                  U5      UU'   M     MD     [9        ['        T R:                  USS	95      m[%        UU4S j['        X=SS	9 5       5      nO([9        ['        T R:                  T R2                  SS	95      mT R<                  S
:X  aU  U Vs1 s H"  n[        US5      (       d  M  UR>                  iM$     nn[+        U5      S
:X  a  URA                  5       OSnSU0mO0 mUU4S jnUUUUUU 4S jmSU;   a  [C        T TT/UQ70 UD6nU" U5      $ TS:X  a  [E        T TT/UQ70 UD6nU[        La  U$ T R<                  S
:  aD  [+        U5      S
:  d  TRF                  S
:  a%  [%        S U 5       5      n[I        TT5      " U0 UD6nOT R<                  S
:X  a%  [%        S U 5       5      n[I        TT5      " U0 UD6nOLTS:X  a2  U(       d+  US   RJ                  nURM                  [I        TT5      5      nO[O        US   TT/UQ70 UD6nU" U5      nU$ s  snnf s  snf )z
Compatibility with numpy ufuncs.

See also
--------
numpy.org/doc/stable/reference/arrays.classes.html#numpy.class.__array_ufunc__
r   )	DataFrameSeries)NDFrame)BlockManager__array_priority____array_ufunc__c              3  8   #    U  H  n[        U5      v   M     g 7fr   )type.0xs     r    	<genexpr>array_ufunc.<locals>.<genexpr>-  s     *6a$q''6s   Tstrict   zCannot apply ufunc z& to mixed DataFrame and Series inputs.Nc              3  r   >#    U  H,  u  p[        UT5      (       a  UR                  " S0 TD6OUv   M.     g 7f)Nr   )
issubclassreindex)r   r   tr   reconstruct_axess      r    r   r   G  s8      
7 .87-C-CAII)()J7s   47namec                ^   > TR                   S:  a  [        U4S jU  5       5      $ T" U 5      $ )Nr   c              3  4   >#    U  H  nT" U5      v   M     g 7fr   r   )r   r   _reconstructs     r    r   3array_ufunc.<locals>.reconstruct.<locals>.<genexpr>X  s     9&Qa&s   )nouttuple)resultr   ufuncs    r    reconstruct array_ufunc.<locals>.reconstructU  s*    ::>9&999F##r$   c                Z  > [         R                  " U 5      (       a  U $ U R                  TR                  :w  a  TS:X  a  [        eU $ [	        U T5      (       a  TR                  X R                  S9n OTR                  " U 40 TDTDSS0D6n [        T5      S:X  a  U R                  T5      n U $ )Nouter)axescopyFr   )
r   	is_scalarndimNotImplementedError
isinstance_constructor_from_mgrr   _constructorlen__finalize__)r   r   	alignablemethodr   reconstruct_kwargsr   s    r    r   !array_ufunc.<locals>._reconstruct\  s    ==  M;;$))# ))Mfl++//[[/IF &&*.@GLF y>Q((.Fr$   outreducec              3  N   #    U  H  n[         R                  " U5      v   M     g 7fr   )npasarrayr   s     r    r   r     s     5frzz!}}fs   #%c              3  6   #    U  H  n[        US S9v   M     g7f)T)extract_numpyNr
   r   s     r    r   r     s     LV}Qd;Vs   __call__r   )(pandas.core.framer   r   pandas.core.genericr   pandas.core.internalsr   r   _standardize_out_kwargr   r   r   ndarrayr   hasattrr   r   _HANDLED_TYPESr   zipr   r   setissubsetr   r   	enumerateuniondict_AXIS_ORDERSr   r   popdispatch_ufunc_with_outdispatch_reduction_ufuncr   getattr_mgrapplydefault_array_ufunc) r   r   r   inputskwargsr   r   clsr   no_deferitemhigher_priorityhas_array_ufunctypesr   r   	set_typesr   objiax1ax2namesr   r   mgrr   r   r   r   r   r   s    ```                       @@@@@@r    array_ufuncr    s    ,2
t*C#-f-F /tUFVVVvVF^# 	

""H
 D./ B''$*A*AA 	
 D+, :T
**(::tT%8%899 	
 oo!!  *6**E&55daAw9O5I 9~
 J	y>A9"5">">y"I"I &%eW,RS  yyQR=C "+3tSXXd+K!L:C))C.Q "M !  D$5$5tD IJ 
F$7
 

  D$5$5tyy NOyyA~!'>A71f+=>!%jAouyy{4$d^$ 0 (ufPvPP6"")$vQQ&Q'M
 yy1}#f+/UZZ!^ 5f55 ':6:	aLVLL':6:	:	f Qinn75&12 %VAYvQQ&Q  FMgB ?s   -O6O61O<
O<c                 |    SU ;  a5  SU ;   a/  SU ;   a)  U R                  S5      nU R                  S5      nX4nX0S'   U $ )z
If kwargs contain "out1" and "out2", replace that with a tuple "out"

np.divmod, np.modf, np.frexp can have either `out=(out1, out2)` or
`out1=out1, out2=out2)`
r   out1out2)r   )r   r  r  r   s       r    r   r     sI     Fv/Ff4Dzz&!zz&!luMr$   c                   UR                  S5      nUR                  SS5      n[        X5      " U0 UD6nU[        L a  [        $ [        U[        5      (       aT  [        U[        5      (       a  [        U5      [        U5      :w  a  [        e[        XWSS9 H  u  p[        XU5        M     U$ [        U[        5      (       a  [        U5      S:X  a  US   nO[        e[        XWU5        U$ )zn
If we have an `out` keyword, then call the ufunc without `out` and then
set the result into the given `out`.
r   whereNTr   r   r   )	r   r   r   r   r   r   r   r   _assign_where)
r   r   r   r   r   r   r
  r   arrress
             r    r   r     s     **U
CJJw%EU#V6v6F&%  #u%%SS[)@%%C5HC#E* 6 
#us8q=a&C%%#u%Jr$   c                B    Uc  XSS& g[         R                  " XU5        g)zN
Set a ufunc result into 'out', masking with a 'where' argument if necessary.
N)r   putmask)r   r   r
  s      r    r  r    s     }A


3v&r$   c                   ^  [        U 4S jU 5       5      (       d  [        eU Vs/ s H  oUT La  UO[        R                  " U5      PM!     nn[	        X5      " U0 UD6$ s  snf )z
Fallback to the behavior we would get if we did not define __array_ufunc__.

Notes
-----
We are assuming that `self` is among `inputs`.
c              3  *   >#    U  H  oTL v   M
     g 7fr   r   )r   r   r   s     r    r   &default_array_ufunc.<locals>.<genexpr>  s     )&QDy&s   )anyr   r   r   r   )r   r   r   r   r   r   
new_inputss   `      r    r   r     s\     )&)))!!AGHA}!"**Q-7JH5!:888 Is   &Ac                |   US:X  d   e[        U5      S:w  d  US   U La  [        $ UR                  [        ;  a  [        $ [        UR                     n[	        X5      (       d  [        $ U R
                  S:  a%  [        U [        5      (       a  SUS'   SU;  a  SUS'   [        X5      " SSS0UD6n[        U5      nU$ )	z8
Dispatch ufunc reductions to self's reduction methods.
r   r   r   Fnumeric_onlyaxisskipnar   )
r   r   r   REDUCTION_ALIASESr   r   r   r   r   r   )r   r   r   r   r   method_namer   s          r    r   r     s     X
6{a6!9D0~~..#ENN3K 4%%yy1}dJ''%*F>" F6N T'?u??F%f-FMr$   )r   np.ufuncr   strr   r   r   r   )returnr   )r   r  r   r  )r  None)__doc__
__future__r   r'   typingr   numpyr   pandas._libsr   pandas._libs.ops_dispatchr   pandas.core.dtypes.castr   pandas.core.dtypes.genericr   pandas.corer	   pandas.core.constructionr   pandas.core.ops.commonr   r  r   r  r   r   r  r   r   r   r$   r    <module>r*     sq    #     G < 1 ! 2 ; 	 Y9 Y9@`F F'9 %r$   