Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/core/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/core/__pycache__/arraylike.cpython-312.pyc

�

Mٜg�D����dZddlmZddlZddlmZddlZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZddd
dd�ZGd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zy)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)�
ABCNDFrame)�	roperator��
extract_array)�unpack_zerodim_and_defer�max�min�sum�prod)�maximum�minimum�add�multiplyc�.�eZdZd�Zed�d��Zed�d��Zed�d��Zed�d	��Zed
�d��Z	ed�d
��Z
d�Zed�d��Zed�d��Z
ed�d��Zed�d��Zed�d��Zed�d��Zd�Zed�d��Zed�d��Zed �d!��Zed"�d#��Zed$�d%��Zed&�d'��Zed(�d)��Zed*�d+��Zed,�d-��Zed.�d/��Zed0�d1��Zed2�d3��Zed4�d5��Zed6�d7��Z ed8�d9��Z!ed:�d;��Z"y<)=�OpsMixinc��tS�N��NotImplemented��self�other�ops   �@/usr/local/lib/python3.12/site-packages/pandas/core/arraylike.py�_cmp_methodzOpsMixin._cmp_method#������__eq__c�B�|j|tj�Sr)r�operator�eq�rrs  rr"zOpsMixin.__eq__&�������x�{�{�3�3r!�__ne__c�B�|j|tj�Sr)rr$�ner&s  rr(zOpsMixin.__ne__*r'r!�__lt__c�B�|j|tj�Sr)rr$�ltr&s  rr+zOpsMixin.__lt__.r'r!�__le__c�B�|j|tj�Sr)rr$�ler&s  rr.zOpsMixin.__le__2r'r!�__gt__c�B�|j|tj�Sr)rr$�gtr&s  rr1zOpsMixin.__gt__6r'r!�__ge__c�B�|j|tj�Sr)rr$�ger&s  rr4zOpsMixin.__ge__:r'r!c��tSrrrs   r�_logical_methodzOpsMixin._logical_methodAr r!�__and__c�B�|j|tj�Sr)r8r$�and_r&s  rr9zOpsMixin.__and__Ds���#�#�E�8�=�=�9�9r!�__rand__c�B�|j|tj�Sr)r8r�rand_r&s  rr<zOpsMixin.__rand__Hs���#�#�E�9�?�?�;�;r!�__or__c�B�|j|tj�Sr)r8r$�or_r&s  rr?zOpsMixin.__or__L����#�#�E�8�<�<�8�8r!�__ror__c�B�|j|tj�Sr)r8r�ror_r&s  rrCzOpsMixin.__ror__P����#�#�E�9�>�>�:�:r!�__xor__c�B�|j|tj�Sr)r8r$�xorr&s  rrGzOpsMixin.__xor__TrBr!�__rxor__c�B�|j|tj�Sr)r8r�rxorr&s  rrJzOpsMixin.__rxor__XrFr!c��tSrrrs   r�
_arith_methodzOpsMixin._arith_method_r r!�__add__c�B�|j|tj�S)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
        )rNr$rr&s  rrOzOpsMixin.__add__bs��p�!�!�%����6�6r!�__radd__c�B�|j|tj�Sr)rNr�raddr&s  rrQzOpsMixin.__radd__�����!�!�%����8�8r!�__sub__c�B�|j|tj�Sr)rNr$�subr&s  rrUzOpsMixin.__sub__�����!�!�%����6�6r!�__rsub__c�B�|j|tj�Sr)rNr�rsubr&s  rrYzOpsMixin.__rsub__�rTr!�__mul__c�B�|j|tj�Sr)rNr$�mulr&s  rr\zOpsMixin.__mul__�rXr!�__rmul__c�B�|j|tj�Sr)rNr�rmulr&s  rr_zOpsMixin.__rmul__�rTr!�__truediv__c�B�|j|tj�Sr)rNr$�truedivr&s  rrbzOpsMixin.__truediv__�s���!�!�%��)9�)9�:�:r!�__rtruediv__c�B�|j|tj�Sr)rNr�rtruedivr&s  rrezOpsMixin.__rtruediv__�s���!�!�%��);�);�<�<r!�__floordiv__c�B�|j|tj�Sr)rNr$�floordivr&s  rrhzOpsMixin.__floordiv__�s���!�!�%��):�):�;�;r!�__rfloordivc�B�|j|tj�Sr)rNr�	rfloordivr&s  r�
__rfloordiv__zOpsMixin.__rfloordiv__�s���!�!�%��)<�)<�=�=r!�__mod__c�B�|j|tj�Sr)rNr$�modr&s  rrozOpsMixin.__mod__�rXr!�__rmod__c�B�|j|tj�Sr)rNr�rmodr&s  rrrzOpsMixin.__rmod__�rTr!�
__divmod__c�.�|j|t�Sr)rN�divmodr&s  rruzOpsMixin.__divmod__�s���!�!�%��0�0r!�__rdivmod__c�B�|j|tj�Sr)rNr�rdivmodr&s  rrxzOpsMixin.__rdivmod__�s���!�!�%��):�):�;�;r!�__pow__c�B�|j|tj�Sr)rNr$�powr&s  rr{zOpsMixin.__pow__�rXr!�__rpow__c�B�|j|tj�Sr)rNr�rpowr&s  rr~zOpsMixin.__rpow__�rTr!N)#�__name__�
__module__�__qualname__rrr"r(r+r.r1r4r8r9r<r?rCrGrJrNrOrQrUrYr\r_rbrerhrnrorrrurxr{r~�r!rrrs�����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�(�W7�)�W7�r�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!rc�v���������� �ddlm}m}ddlm�ddlm�m�t��}tdi|��}t���g|��i|��}|tur|Stjj|jf}	|D]s}
t|
d�xr|
j �j kD}t|
d�xr0t|
�j|	vxrt#|
�j$�}|s|s�mtcSt'd�|D��}
t)||
�D��cgc]\}}t+|��s�|��c}}�t-��dkDr�t/|
�}t-|�dkDr"||hj1|�rt3d	��d
����j4}�ddD]@}t7t)||j4��D]\}\}}|j9|�||<��Bt;t)�j<|���t'��fd�t)||
�D��}n)t;t)�j<�j4����j>dk(rI|D�cgc]}t|d
�s�tA|d
���}}t-t/|��dk(r|dnd}d
|i� ni� ��fd�}������ �fd��d|vrtC���g|��i|��}||�S�dk(rtE���g|��i|��}|tur|S�j>dkDrBt-|�dkDs�jFdkDr%t'd�|D��}tA���|i|��}nz�j>dk(r%t'd�|D��}tA���|i|��}nF�dk(r-|s+|djH}|jKtA����}ntM|d��g|��i|��}||�}|Scc}}wcc}w)z�
    Compatibility with numpy ufuncs.

    See also
    --------
    numpy.org/doc/stable/reference/arrays.classes.html#numpy.class.__array_ufunc__
    r)�	DataFrame�Series)�NDFrame)�ArrayManager�BlockManager�__array_priority__�__array_ufunc__c3�2K�|]}t|����y�wr)�type��.0�xs  r�	<genexpr>zarray_ufunc.<locals>.<genexpr>,s����*�6�a�$�q�'�6�s��zCannot apply ufunc z& to mixed DataFrame and Series inputs.Nc3�d�K�|]'\}}t|��r|jdi���n|���)y�w)Nr�)�
issubclass�reindex)r�r��tr��reconstruct_axess   ��rr�zarray_ufunc.<locals>.<genexpr>Ds:�����
�*���1�.8��7�-C�I�A�I�I�)�(�)��J�*�s�-0�namec�Z���jdkDrt�fd�|D��S�|�S)Nr�c3�.�K�|]}�|����y�wrr�)r�r��_reconstructs  �rr�z3array_ufunc.<locals>.reconstruct.<locals>.<genexpr>Us�����9�&�Q��a��&�s�)�nout�tuple)�resultr��ufuncs ��r�reconstructz array_ufunc.<locals>.reconstructRs*����:�:��>��9�&�9�9�9��F�#�#r!c�J��tj|�r|S|j�jk7r
�dk(rt�|St	|��f�r�j||j��}n�j|fi����ddi��}t��dk(r|j��}|S)N�outer)�axes�copyFr�)
r�	is_scalar�ndim�NotImplementedError�
isinstance�_constructor_from_mgrr��_constructor�len�__finalize__)r�r�r��	alignable�methodr��reconstruct_kwargsrs �������rr�z!array_ufunc.<locals>._reconstructYs�����=�=�� ��M��;�;�$�)�)�#��� �)�)��M��f�|�\�:�;��/�/��V�[�[�/�I�F�'�T�&�&���*��.@��GL��F��y�>�Q���(�(��.�F��
r!�out�reducec3�FK�|]}tj|����y�wr)�np�asarrayr�s  rr�zarray_ufunc.<locals>.<genexpr>�s����5�f��r�z�z�!�}�f�s�!c3�6K�|]}t|d�����y�w)T)�
extract_numpyNr	r�s  rr�zarray_ufunc.<locals>.<genexpr>�s����L�V��}�Q�d�;�;�V�s��__call__r�)'�pandas.core.framer�r��pandas.core.genericr��pandas.core.internalsr�r�r��_standardize_out_kwargrrr��ndarrayr��hasattrr�r��_HANDLED_TYPESr��zipr�r��set�issubsetr�r��	enumerate�union�dict�_AXIS_ORDERSr��getattr�dispatch_ufunc_with_out�dispatch_reduction_ufuncr��_mgr�apply�default_array_ufunc)!rr�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�r�s!```                       @@@@@@@r�array_ufuncr��s������,��
�t�*�C�
#�
-�f�
-�F�/�t�U�F�
V�V�
V�v�
V�F�
�^�#��
�	�
�
�"�"�����H�
���D�.�/�
B��'�'�$�*A�*A�A�	�

�D�+�,�
:��T�
�*�*�(�:�
:��t�T�%8�%8�9�9�	�
�o�!�!��
�*�6�*�*�E�"�6�5�1�L�1�t�q�!�Z��7�5K��1�L�I�
�9�~���
��J�	��y�>�A��9�f�"5�">�">�y�"I�&�%�e�W�,R�S��
��y�y���Q�R�=�C�"+�3�t�S�X�X�+>�!?�
��:�C���)�)�C�.��Q��"@�!� ��D�$5�$5�t� <�=���
��F�E�*�
�
��
 ��D�$5�$5�t�y�y� A�B���y�y�A�~�-3�J�V��w�q�&�7I���F�#�V��J��s�5�z�?�a�/�u�Q�x�T��$�d�^����$���0
���(��u�f�P�v�P��P���6�"�"�
���)�$��v�Q��Q�&�Q����'��M�
�y�y�1�}�#�f�+��/�U�Z�Z�!�^��5�f�5�5��(����'��:�6�:��	
���a���L�V�L�L��'����'��:�6�:���Z�����)�.�.�C��Y�Y�w�u�f�5�6�F�)����E�6�U�F�U�f�U�F���
 �F��M��eM��>Ks�N0�&N0�N6�N6c�t�d|vr3d|vr/d|vr+|jd�}|jd�}||f}||d<|S)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)�pop)r�r�r�r�s    rr�r��sM��
�F��v��/�F�f�4D��z�z�&�!���z�z�&�!���T�l����u�
��Mr!c��|jd�}|jdd�}t||�|i|��}|turtSt|t�rPt|t�rt|�t|�k7rt�t||�D]\}}	t||	|��|St|t�rt|�dk(r|d}nt�t|||�|S)zz
    If we have an `out` keyword, then call the ufunc without `out` and then
    set the result into the given `out`.
    r��whereNr�r)	r�r�rr�r�r�r�r��
_assign_where)
rr�r�r�r�r�r�r��arr�ress
          rr�r��s����*�*�U�
�C��J�J�w��%�E�
#�W�U�F�
#�V�
6�v�
6�F�
������&�%� ��#�u�%��S��S��[�)@�%�%��C��(�H�C���#�s�E�*�)��
��#�u���s�8�q�=��a�&�C�%�%��#�v�u�%��Jr!c�B�|�||ddytj|||�y)zV
    Set a ufunc result into 'out', masking with a 'where' argument if necessary.
    N)r��putmask)r�r�r�s   rr�r��s"��
�}���A��
�
�
�3��v�&r!c���t�fd�|D��st�|D�cgc]}|�ur|ntj|���}}t	||�|i|��Scc}w)z�
    Fallback to the behavior we would get if we did not define __array_ufunc__.

    Notes
    -----
    We are assuming that `self` is among `inputs`.
    c3�&�K�|]}|�u���
y�wrr�)r�r�rs  �rr�z&default_array_ufunc.<locals>.<genexpr>�s�����)�&�Q�q�D�y�&�s�)�anyr�r�r�r�)rr�r�r�r�r��
new_inputss`      rr�r��s_����)�&�)�)�!�!�AG�H��A�q��}�!�"�*�*�Q�-�7��J�H�!�7�5�&�!�:�8��8�8��Is�"Ac�B�|dk(sJ�t|�dk7s|d|urtS|jtvrtSt|j}t	||�stS|j
dkDrt
|t�rd|d<d|vrd|d<t||�dddi|��S)	z@
    Dispatch ufunc reductions to self's reduction methods.
    r�r�rF�numeric_only�axis�skipnar�)	r�rr��REDUCTION_ALIASESr�r�r�rr�)rr�r�r�r��method_names      rr�r��s����X����
�6�{�a��6�!�9�D�0����~�~�.�.���#�E�N�N�3�K��4��%����y�y�1�}��d�J�'�%*�F�>�"�����F�6�N�&�7�4��%�=�U�=�f�=�=r!)r��np.ufuncr��strr�rr�r)�returnr�)r�r�r�r�)r��None)�__doc__�
__future__rr$�typingr�numpyr��pandas._libsr�pandas._libs.ops_dispatchr�pandas.core.dtypes.genericr�pandas.corer�pandas.core.constructionr
�pandas.core.ops.commonrr�rr�r�r�r�r�r�r�r!r�<module>rsn���#�����G�1�!�2�;�����	��W9�W9�|b�J� �F'�
9� #>r!

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists