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__/flags.cpython-312.pyc

�

Mٜg���H�ddlmZddlmZddlZerddlmZGd�d�Zy)�)�annotations)�
TYPE_CHECKINGN)�NDFramec��eZdZUdZdhZded<d
d�Zedd��Zejdd��Zdd�Z
dd	�Zdd
�Zdd�Z
y)�Flagsa
    Flags that apply to pandas objects.

    Parameters
    ----------
    obj : Series or DataFrame
        The object these flags are associated with.
    allows_duplicate_labels : bool, default True
        Whether to allow duplicate labels in this object. By default,
        duplicate labels are permitted. Setting this to ``False`` will
        cause an :class:`errors.DuplicateLabelError` to be raised when
        `index` (or columns for DataFrame) is not unique, or any
        subsequent operation on introduces duplicates.
        See :ref:`duplicates.disallow` for more.

        .. warning::

           This is an experimental feature. Currently, many methods fail to
           propagate the ``allows_duplicate_labels`` value. In future versions
           it is expected that every method taking or returning one or more
           DataFrame or Series objects will propagate ``allows_duplicate_labels``.

    Examples
    --------
    Attributes can be set in two ways:

    >>> df = pd.DataFrame()
    >>> df.flags
    <Flags(allows_duplicate_labels=True)>
    >>> df.flags.allows_duplicate_labels = False
    >>> df.flags
    <Flags(allows_duplicate_labels=False)>

    >>> df.flags['allows_duplicate_labels'] = True
    >>> df.flags
    <Flags(allows_duplicate_labels=True)>
    �allows_duplicate_labelszset[str]�_keysc�F�||_tj|�|_y�N)�_allows_duplicate_labels�weakref�ref�_obj)�self�objrs   �</usr/local/lib/python3.12/site-packages/pandas/core/flags.py�__init__zFlags.__init__3s��(?��%��K�K��$��	�c��|jS)a�
        Whether this object allows duplicate labels.

        Setting ``allows_duplicate_labels=False`` ensures that the
        index (and columns of a DataFrame) are unique. Most methods
        that accept and return a Series or DataFrame will propagate
        the value of ``allows_duplicate_labels``.

        See :ref:`duplicates` for more.

        See Also
        --------
        DataFrame.attrs : Set global metadata on this object.
        DataFrame.set_flags : Set global flags on this object.

        Examples
        --------
        >>> df = pd.DataFrame({"A": [1, 2]}, index=['a', 'a'])
        >>> df.flags.allows_duplicate_labels
        True
        >>> df.flags.allows_duplicate_labels = False
        Traceback (most recent call last):
            ...
        pandas.errors.DuplicateLabelError: Index has duplicates.
              positions
        label
        a        [0, 1]
        )r�rs rrzFlags.allows_duplicate_labels7s��<�,�,�,rc��t|�}|j�}|�td��|s!|jD]}|j	��||_y)Nz$This flag's object has been deleted.)�boolr�
ValueError�axes�_maybe_check_uniquer)r�valuer�axs    rrzFlags.allows_duplicate_labelsWsN���U����i�i�k���;��C�D�D���h�h���&�&�(��).��%rc�L�||jvrt|��t||�Sr)r	�KeyError�getattr)r�keys  r�__getitem__zFlags.__getitem__ds%���d�j�j� ��3�-���t�S�!�!rc�p�||jvrtd|�d|j����t|||�y)Nz
Unknown flag z. Must be one of )r	r�setattr)rr!rs   r�__setitem__zFlags.__setitem__js7���d�j�j� ��}�S�E�1B�4�:�:�,�O�P�P���c�5�!rc�"�d|j�d�S)Nz<Flags(allows_duplicate_labels=z)>)rrs r�__repr__zFlags.__repr__os��0��1M�1M�0N�b�Q�Qrc�`�t|t|��r|j|jk(Sy)NF)�
isinstance�typer)r�others  r�__eq__zFlags.__eq__rs*���e�T�$�Z�(��/�/�5�3P�3P�P�P�rN)rrrr�return�None)r-r)rrr-r.)r!�str)r!r/r-r.)r-r/)�__name__�
__module__�__qualname__�__doc__r	�__annotations__r�propertyr�setterr"r%r'r,�rrrr
s_��$�L1�1�E�8�1�%��-��-�>�#�#�
.�$�
.�"�"�
R�rr)�
__future__r�typingrr
�pandas.core.genericrrr7rr�<module>r;s ��"� ���+�k�kr

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