Sindbad~EG File Manager

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

�

Mٜgb���UddlmZddlmZddlmZddlZddlmZddlZddl	m
Z
mZmZm
Z
mZmZmZmZmZddlZddlZddlmZmZmZddlmZmZmZm Z m!Z!dd	l"m#Z#ddl$m%cm&Z'dd
l(m)Z)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@dd
lAmBZCddlDmEZEmFZFddlGmHZHmIZImJZJmKZKddlLmMZMmNZNddlOmPZPmQZQddlRmSZSmTZTmUZUmVZVmWZWmXZXmYZYddlZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmddlnmoZoddlpmqZqmrZrmsZsmtZtmuZumvZvmwZwddlxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm�Z�m�Z�ddl�m�Z�ddl�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�ddl�m�Z�ddl�m�cm�Zddl�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�ddl�m�Z�m�Z�ddl�m�cm�Z�ddl�m�Z�m�Z�m�Z�dd l�m�Z�m�Z�dd!l�m�Z�dd"l�m�Z�dd#l�m�Z�dd$l�m�Z�dd%l�m�Z�m�Z�m�Z�dd&l�m�Z�dd'l�m�Z�m�Z�m�Z�m�Z�e
rdd(l�m�Z�m�Z�m�Z�dd)l�m�Z�m�Z�m�Z�m�Z�dd*l�m�Z�m�Z�d+gZ�e�d,�Z�d+d-d+d-d+d.d/�Z�d0e�d1<iZ�d0e�d2<e�Z�e�j�d3�Z�id4e�j��d5e�j��d6e�j��d7e�j��d8e�j��d9e�j��d:e�j��d;e�j��d<e�j��d=e�j��d>e�j��d?e�j��d@e�j��dAe�j��dBe�j��dCe�j��dDe�j��e�j�e�j�e�j�e�j�e�j�e�j�e�j�e�j�e�j�dE�	�Z�dVdF�Z�dG�Z�GdH�d+e�e��Z�dWdXdI�Z�dYdZdJ�Z�dK�Z�d[dL�Z�d\dM�Z�d]dN�Z�d^dO�Z�d_dP�Z�d`dQ�Z�dRdddSdT�							dadU�Z�y)b�)�annotations)�abc)�datetimeN)�zip_longest)	�
TYPE_CHECKING�Any�Callable�ClassVar�Literal�NoReturn�cast�final�overload)�
get_option�using_copy_on_write�using_pyarrow_string_dtype)�NaT�algos�index�lib�writers)�BlockValuesRefs)�is_datetime_array�
no_default)�IncompatibleFrequency�OutOfBoundsDatetime�	Timestamp�
tz_compare)�AnyAll�	ArrayLike�Axes�Axis�DropKeep�DtypeObj�F�IgnoreRaise�
IndexLabel�JoinHow�Level�
NaPosition�
ReindexMethod�Self�Shape�npt)�function)�DuplicateLabelError�InvalidIndexError)�Appender�cache_readonly�deprecate_nonkeyword_arguments�doc)�find_stack_level�rewrite_exception)�astype_array�astype_is_view)�LossySetitemError�can_hold_element�common_dtype_categorical_compat�find_result_type�infer_dtype_from�maybe_cast_pointwise_result�np_can_hold_element)�ensure_int64�
ensure_object�ensure_platform_int�is_any_real_numeric_dtype�
is_bool_dtype�is_ea_or_datetimelike_dtype�is_float�is_hashable�
is_integer�is_iterator�is_list_like�is_numeric_dtype�is_object_dtype�	is_scalar�is_signed_integer_dtype�is_string_dtype�needs_i8_conversion�pandas_dtype�validate_all_hashable)�
concat_compat)�
ArrowDtype�CategoricalDtype�DatetimeTZDtype�ExtensionDtype�
IntervalDtype�PeriodDtype�SparseDtype)	�ABCCategoricalIndex�ABCDataFrame�ABCDatetimeIndex�ABCIntervalIndex�
ABCMultiIndex�ABCPeriodIndex�
ABCRangeIndex�	ABCSeries�ABCTimedeltaIndex)�is_dict_like)�array_equivalent�is_valid_na_for_dtype�isna)�	arraylike�nanops�ops)�CachedAccessor)�setitem_datetimelike_compat�validate_putmask)�ArrowExtensionArray�BaseMaskedArray�Categorical�
DatetimeArray�ExtensionArray�TimedeltaArray)�StringArray�StringDtype)�
IndexOpsMixin�PandasObject)�ensure_wrapped_if_datetimelike�
extract_array�sanitize_array)�disallow_ndim_indexing�is_valid_positional_slice)�
FrozenList)�clean_reindex_fill_method)�get_op_result_name)�make_invalid_op)�ensure_key_mapped�get_group_index_sorter�nargsort)�
StringMethods)�
PrettyDict�default_pprint�format_object_summary�pprint_thing)�Hashable�Iterable�Sequence)�CategoricalIndex�	DataFrame�
MultiIndex�Series)�
IntervalArray�PeriodArray�Index)�mixed�
mixed-integer��
np.ndarray)�klass�inplace�target_klass�raises_section�unique�
duplicatedzdict[str, str]�_index_doc_kwargs�_index_shared_docs�object�
Complex128�	Complex64�Float64�Float32�UInt64�UInt32�UInt16�UInt8�Int64�Int32�Int16�Int8�booleanzdouble[pyarrow]zfloat64[pyarrow]zfloat32[pyarrow]zfloat[pyarrow])	zuint64[pyarrow]zuint32[pyarrow]zuint16[pyarrow]zuint8[pyarrow]zint64[pyarrow]zint32[pyarrow]zint16[pyarrow]z
int8[pyarrow]z
bool[pyarrow]c�z��tj��ddddd�							d�fd��}tt|�S)zG
    Decorator to simplify 'return_indexers' checks in Index.join.
    �leftNF��how�level�return_indexers�sortc�l���	|||||��\}}}|s|S|�t|�}|�t|�}|||fS)N�r�r�r�)rC)
�self�otherr�r�r�r��
join_index�lidx�ridx�meths
         ��C/usr/local/lib/python3.12/site-packages/pandas/core/indexes/base.py�joinz$_maybe_return_indexers.<locals>.join
sT���"&�d�E�s�%�d�!S��
�D�$������&�t�,�D���&�t�,�D��4��%�%�)r�r�r�r(r��boolr�r�)�	functools�wrapsr
r%)r�r�s` r��_maybe_return_indexersr�sb���
�_�_�T��
�� %��&��&��	&��
&��&��&�&��4�=�r�c��t|t�rddlm}||fi|��St|t�r"d|vrd|vr|jd�|d<d|d<nd|vrd|vr|dj|d<|j|fi|��S)	zv
    This is called upon unpickling, rather than the default which doesn't
    have arguments and breaks __new__.
    r)�_new_PeriodIndex�labels�codesF�verify_integrity�dtype�data)�
issubclassra�pandas.core.indexes.periodr�r`�popr��__new__)�cls�dr�s   r��
_new_Indexr�$s����#�~�&�?���)�q�)�)��#�}�%��q�=�W�A�-����x��A�g�J�!&��
��	��	�f��k��v�Y�_�_��'�
��3�;�;�s� �a� � r�c���eZdZUdZdZe�dd��Ze				�d d��Ze				�d d��Ze				�d d��Z	dZ
ded	<d
ed<ejefZded
<dZded<dZded<dZded<dgZded<dgZded<e�d!d��Zej.ej0�ej4ej.ej6�ej8ej.ej:�ej<ej.ej>�ej@ej.ejB�ejDej.ejF�ejHej.ejJ�ejLej.ejN�ejPej.ejR�ejTej.ejV�ejXej.ejZ�ej\ej.ej^�ej`iZ1ded<e2		�d"d��Z3dZ4dhZ5e6de7�Z8dZ9					�d#					�d$d�Z:e;�d%d ��Z<ee;�d&d!���Z=e;	�d'					�d(d"��Z>e;d#��Z?e�d)d$��Z@e�d*d%��ZAe�d+d&��ZBeCf�d,d'�ZD�d-d(�ZEe�d,d)��ZFe�d!d*��ZGe�d*d+��ZHe�d*d,��ZIe		�d.d-��ZJee�d/d.���ZK�d0d/�ZL�d'�d1d0�ZM�d2d1�ZNe�d3d2��ZOe�d4d3��Ze�d5�d6d4��ZP�d7d5�ZQ�d8�d%d6�ZRd7eSd8<eTeSd8eUz�			�d9					�d:d9��ZVe�d;d:��ZWd;eSd<<eTeSd<eUz��d7�d<d=��ZX		�d3					�d=d>�ZYe�d-d?��ZZe�d7�d-d@��Z[e�d>dA��Z\e2dB��Z]e�d7�d>dC��Z^�d?dD�Z_e�d@dE��Z`e�d1dF��Za			�dA							�dBdH�ZbdGZceddI�					�dCdJ��Zd�dDdK�ZedLdMddddN�					�dEdO�Zf�d7�d>dP�Zg�d-dQ�Zhe�d'�dFdR��Zidejj�f					�dGdS�Zke2�dHdT��Zlelj��dIdU��Zle	�dJ			�dKdV��Zn	�d'			�dLdW�Zo�dMdX�ZpddY��d*dZ�Zqe2eqep�[�Zresd\d\d]��dNd^��Ztesd\dY��dOd_��Ztesd\d\d]��dPd`��Ztddd]��dPda�Ztesd\db��dNdc��Zues�dOdd��Zuevdedfdgdg�h��dQ�dPdi��Zue2�d0dj��Zw�d-dk�Zxe�d*dl��Zy�d0dm�Zz				�dR			�dSdo�Z{�dTdp�Z|e|Z}e�dU�dVdq��Z~e�dWdr��Zee�d!ds���Z�e2�d!dt��Z�e2�d!du��Z�ee2�d!dv���Z�ee2�d!dw���Z�e�d!dx��Z�ee2�d!dy���Z�e�d!dz��Z�e�d!d{��Z�e�d!d|��Z�e�d!d}��Z�e�d!d~��Z�e�d!d��Z�e�d!d���Z�e�d!d���Z�e�d!d���Z�e�d>d���Z�ee�d!d����Z�ee�d!d����Z�d��Z�ed���Z�e�dXd���Z�e�d!d���Z�e�dXd���Z�e�Z�e�dXd���Z�e�Z�dejj�fd��Z��dY�dZd��Z��d7�d[�fd��
Z�dnd���d\�fd��Z��d]�d^d��Z�d��Z�e�d_d���Z�e�Z�d��Z�ed���Z�e�d`d���Z�e�d7d���Z��dad��Z�e�dbd���Z�e�dQ�dcd���Z��dQ�ddd��Z�d��Z�e				�ded���Z�e�d7d���Z�d��Z�d��Z��d'd��Z�e�d!d���Z��dfd��Z�d��Z�e			�dg					�dhd���Z�			�dg							�did��Z�e�djd���Z�e		�d'					�dkd���Z��dld��Z�e	�d'							�dmd���Z�e	�d7							�dmd���Z�e						�dnd���Z�e						�dod���Z�e						�dpd���Z�e�dqd���Z��drd��Z�eejj�f					�dsd���Z�e�dtd���Z�				�du							�dvd��Zdwd��ZÐdxd��Z�e				�dyd���Z�esd\d\d\d��											�dzd���Z�esd\d\d\d\d��											�d{d���Z�esd\d\d\d\d��											�d|d���Z�ee�d�dddd��											�d}d����Z�e								�d~d���Z�e								�d~d���Z�e�dd���Z�e	�d�							�d�d���Z�e	�d�							�d�d„�Z�e	�d�					�d�dÄ�Z�										�d�dĄZ�ee�d!dń��Z�e2�d�dƄ�Z�ee�eҐj���d�dDŽ��Z�e2�d�dȄ�ZԐd�dɄZ�e�d1dʄ�Z֐d�d˄Z�e�eҐj���dQ�d�d̄�Z�e�d7�dTd̈́�Z�ee;d΄��Z�dτZܐd!dЄZݐd�dфZ�d�ed�<e�d*dԄ�Z�dՄZ�d�dքZ�e�d!dׄ�Z�d�d؄Z�d�dلZ�dTdڄZ�d�dۄZ�e�d!d܄�Z�ed݄�Z�						�d�dބZ�esd\d\d\d\dߜ									�d�d��Z�esd\d\d\d�									�d�d��Z�esd\d\d\d\dߜ									�d�d��Z�evdedfgd�h�				�d�									�d�d��Z�ed��Z�d��d�d�Z�d�d�Z�d�Z�e�d!d��Z�d�eSd�<eTeSd�eUz�		�d�d��Z�e�d�d��Z�d�d�Z�d�d�Z�es	�d�					�d�d��Z�es						�d�d��Z�es	�d8					�d�d��Z�e	�d8					�d�d��Z�e2�d!d���Z�d�Z�e�d�d���Z�e�d4d���Z�e�d�d���Z��d�d��Z�e�d�d���Z��d7�d�d��Z�eddY��dTd���Z��d7�dXd��Z��d�d��Z�			�dg							�d��d��Z�d��Z�dT�d��Ze						�d��d���Z�d��d��Z�d��d��d��Z�d��d��Z�dg�d��d��Z�d-�d��Z�d��d	��Z		�d�					�d��d
��Z
e�d8�d��d���Ze�d��d��d���Ze�dU�d��d
���Z
�d��Ze�d���Ze�d���Z�f�d��Ze�d���Z�dT�d��Z�dT�d��Z�dT�d��Z�dT�d��Z�d��Z�d��Ze�d��d���ZeTeҐj4j��d��d��f�d�
��ZeTeҐj6j��d��d��f�d�
��Z�d��d��d��Z�d��d��d��Zee2�d��d����Z�x�ZS(�r�a(
    Immutable sequence used for indexing and alignment.

    The basic object storing axis labels for all pandas objects.

    .. versionchanged:: 2.0.0

       Index can hold all numpy numeric dtypes (except float16). Previously only
       int64/uint64/float64 dtypes were accepted.

    Parameters
    ----------
    data : array-like (1-dimensional)
    dtype : str, numpy.dtype, or ExtensionDtype, optional
        Data type for the output Index. If not specified, this will be
        inferred from `data`.
        See the :ref:`user guide <basics.dtypes>` for more usages.
    copy : bool, default False
        Copy input data.
    name : object
        Name to be stored in the index.
    tupleize_cols : bool (default: True)
        When True, attempt to create a MultiIndex if possible.

    See Also
    --------
    RangeIndex : Index implementing a monotonic integer range.
    CategoricalIndex : Index of :class:`Categorical` s.
    MultiIndex : A multi-level, or hierarchical Index.
    IntervalIndex : An Index of :class:`Interval` s.
    DatetimeIndex : Index of datetime64 data.
    TimedeltaIndex : Index of timedelta64 data.
    PeriodIndex : Index of Period data.

    Notes
    -----
    An Index instance can **only** contain hashable objects.
    An Index instance *can not* hold numpy float16 dtype.

    Examples
    --------
    >>> pd.Index([1, 2, 3])
    Index([1, 2, 3], dtype='int64')

    >>> pd.Index(list('abc'))
    Index(['a', 'b', 'c'], dtype='object')

    >>> pd.Index([1, 2, 3], dtype="uint8")
    Index([1, 2, 3], dtype='uint8')
    i�c�n�|j�}|j�}tj||�S�N)�_get_join_target�libjoin�left_join_indexer_unique)r�r��sv�ovs    r��_left_indexer_uniquezIndex._left_indexer_unique}s3���
"�
"�
$��
�
#�
#�
%���/�/��B�7�7r�c��|j�}|j�}tj||�\}}}|j|�}|||fSr�)r�r��left_join_indexer�_from_join_target�r�r�r�r��joined_ndarrayr�r��joineds        r��
_left_indexerzIndex._left_indexer�sV��
�
"�
"�
$��
�
#�
#�
%��%,�%>�%>�r�2�%F�"���d��'�'��7���t�T�!�!r�c��|j�}|j�}tj||�\}}}|j|�}|||fSr�)r�r��inner_join_indexerr�r�s        r��_inner_indexerzIndex._inner_indexer��V��
�
"�
"�
$��
�
#�
#�
%��%,�%?�%?��B�%G�"���d��'�'��7���t�T�!�!r�c��|j�}|j�}tj||�\}}}|j|�}|||fSr�)r�r��outer_join_indexerr�r�s        r��_outer_indexerzIndex._outer_indexer�r�r�r�str�_typ�ExtensionArray | np.ndarray�_datazDtype[ExtensionArray] | tuple[type[np.ndarray], type[ExtensionArray]]�	_data_clsNz
object | None�_idr��_nameFr��_no_setting_name�name�	list[str]�_comparables�_attributesc�.�t|j�Sr�)rLr��r�s r��_can_hold_stringszIndex._can_hold_strings�s��#�D�J�J�/�/�/r�z;dict[np.dtype | ExtensionDtype, type[libindex.IndexEngine]]�
_engine_typesc�j�|jj|jtj�Sr�)r��getr��libindex�ObjectEnginer�s r��_engine_typezIndex._engine_type�s'���!�!�%�%�d�j�j�(�2G�2G�H�Hr�Tc���ddlm}t|||�}|�t|�}t	|dd�}d}|s"t|ttf�r|j}t|tttf�}	t|t|f�r"||||��}
|�|
j|d��S|
St|�r�n�t|�r�n�t|tjttf�rRt|t�r|j }|j"j$dv�rYt'j(|t*��}�n<t-|�r|j/|��t1|d	�r|tj2|�|||�
�St5|�s!t|t6�s|j/|��|rDt9|�rt;|�}|r,t=d�|D��rddlm }|jB||�
�St|t:tDf�st;|�}tG|�dk(rtjH|tJ��}tG|�r.t|dtD�rt'j(|t*��}	tM|d||��}tS|�}|jU|j"�}|jW||j"d��}|jY|||��}
|�@|	r>|tjZk(r+|
j"|k7rt]j^dt`d��|
S#tN$r>}
dtQ|
�vr|j/|�|
�dtQ|
�vrtOd�|
��d}
~
wwxYw)Nr)�
RangeIndexr�)�start�copyr�F�r�iufcbmM�r��	__array__�r�rr�c3�<K�|]}t|t����y�wr�)�
isinstance�tuple)�.0�es  r��	<genexpr>z Index.__new__.<locals>.<genexpr>s����C�d��
�1�e� 4�d����r���names�r�rz2index must be specified when data is not list-likezData must be 1-dimensional� Index data must be 1-dimensional)�refsz�Dtype inference on a pandas object (Series, Index, ExtensionArray) is deprecated. The Index constructor will keep the original dtype in the future. Call `infer_objects` on the result to get the old behavior.���
stacklevel)1�pandas.core.indexes.ranger��maybe_extract_namerR�getattrrrcr��_referencesrs�range�astyperF�np�ndarrayr`�_valuesr��kind�com�asarray_tuplesafe�
_dtype_objrN�_raise_scalar_data_error�hasattr�asarrayrK�
memoryviewrJ�list�all�pandas.core.indexes.multir��from_tuplesr	�len�arrayr�r{�
ValueErrorr�ry�_dtype_to_subclass�
_ensure_array�_simple_new�object_�warnings�warn�
FutureWarning)r�r�r�rr��
tupleize_colsr��
data_dtyper�is_pandas_object�resultr��arr�errr�s               r�r�z
Index.__new__�s��	9�!�$��c�2���� ��'�E��T�7�D�1�
����
�4�)�U�);�<��#�#�D�%�d�Y��~�,N�O���d�U�J�/�0��d��D�A�F�� ��}�}�U��}�7�7��M�
(��
/��
(��
4��
��r�z�z�5�)�<�
=��$�
�.��|�|���z�z���i�/�
�,�,�T��D��
�t�_��.�.�t�4�4�
�T�;�
'��r�z�z�$�'�u�4�d�K�K��d�#�J�t�Z�,H��.�.�t�4�4���t�$���:�D��C�C�d�C�C�E�2�:�1�1��D���
�d�T�5�M�2��D�z���4�y�A�~��x�x��F�3���4�y�Z��Q���7��,�,�T��D��	� ��t�5�t�D�C�-�S�1���&�&�s�y�y�1���!�!�#�s�y�y�u�!�=���"�"�3��4�"�8���=�-�*��
�
�2J��|�|�z�)��
�
� �
"� ���
��/�	�C�s�3�x�O��2�2�4�8�c�A�+�s�3�x�7� �!C�D�#�M���	�s�1L�	M#�%9M�M#c��|jdkDrtd��|tjk(rt	d��|r|j�}|S)zF
        Ensure we have a valid array to pass to _simple_new.
        �rz!float16 indexes are not supported)�ndimr.r�float16�NotImplementedErrorr)r�r�r�rs    r�r0zIndex._ensure_arrayOsH��
�9�9�q�=��?�@�@�
�b�j�j�
 �%�&I�J�J���9�9�;�D��r�c�,�t|t�r|jS|jdk(rddlm}|S|jdk(rddlm}|S|jdk(rtSt|jt�st|�rtSt|��)N�Mr)�
DatetimeIndex�m)�TimedeltaIndex�O)
rrX�index_classr �pandasrCrEr�r��typer�rLr@)r�r�rCrEs    r�r/zIndex._dtype_to_subclassas{��
�e�^�,��$�$�$��:�:���,� � �
�Z�Z�3�
�-�!�!�
�Z�Z�3�
��L�
��
�
�C�
(�,<�U�,C��L�!�%�(�(r�c�.�t||j�sJt|���tj	|�}||_||_i|_|j�|�||_	nt�|_	|jj|�|S)z�
        We require that we have a dtype compat for the values. If we are passed
        a non-dtype compat, then coerce using the constructor.

        Must be careful not to recurse.
        )rr�rIr�r�r�r��_cache�_reset_identityrr�add_index_reference)r��valuesr�rr9s     r�r1zIndex._simple_new�s����&�#�-�-�0�>�$�v�,�>�0�����$����������
���� ���!%�F��!0�!2�F�����.�.�v�6��
r�c���||i|��}|jtk(rZ|jsNtj|j
�}|jjdvrt||j��S|S)zw
        Constructor that uses the 1.0.x behavior inferring numeric dtypes
        for ndarray[object] inputs.
        �iufb�r�)	r�r#�	_is_multir�maybe_convert_objectsrr r�r�)r��args�kwargsr9rNs     r��_with_inferzIndex._with_infer�se���d�%�f�%���<�<�:�%�f�.>�.>��.�.�v�~�~�>�F��|�|� � �F�*��V�&�+�+�6�6��
r�c��t|�Sr�)rIr�s r��_constructorzIndex._constructor�s���D�z�r�c�f�|js%d}|j�}|d|��z
}t|��y)a:
        Check that an Index has no duplicates.

        This is typically only called via
        `NDFrame.flags.allows_duplicate_labels.setter` when it's set to
        True (duplicates aren't allowed).

        Raises
        ------
        DuplicateLabelError
            When the index is not unique.
        zIndex has duplicates.�
N)�	is_unique�_format_duplicate_messager0)r��msg�
duplicatess   r��_maybe_check_uniquezIndex._maybe_check_unique�s?���~�~�-�C��7�7�9�J��R�
�|�$�$�C�%�c�*�*�r�c���ddlm}||jd��j�}t	|�sJ�|tjt	|��d��j|d��jt�|}|jr)t|�j|j�|_
|jdk(r|jd	�}|j!d
��S)a�
        Construct the DataFrame for a DuplicateLabelError.

        This returns a DataFrame indicating the labels and positions
        of duplicates in an index. This should only be called when it's
        already known that duplicates are present.

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'a'])
        >>> idx._format_duplicate_message()
            positions
        label
        a        [0, 2]
        r�r��first��keepFr)�observedr=�label�	positionsrQ)rHr�r�r�r,r�arange�groupby�aggr(rRrIr+r�nlevels�rename_axis�to_frame)r�r�r^�outs    r�r\zIndex._format_duplicate_message�s���"	"��$�/�/�w�/�7�8�?�?�A�
��:����
�2�9�9�S��Y�'�e�4�
�W�T�E�W�
*�
�S��Y�z�
#�	�
�>�>��T�
�.�.�s�y�y�9�C�I��<�<�1���/�/�'�*�C��|�|��|�-�-r�c�j�|tur|jn|}|j|||j��S)az
        Create a new Index with the same class as the caller, don't copy the
        data, use the same object attributes with passed in attributes taking
        precedence.

        *this is an internal non-public method*

        Parameters
        ----------
        values : the values to create the new Index, optional
        name : Label, defaults to self.name
        �r�r)rr�r1r)r�rNr�s   r��
_shallow_copyzIndex._shallow_copy�s4��"�Z�/�t�z�z�T������T��8H�8H��I�Ir�c��|j|j|j|j��}|j|_|S)zR
        fastpath to make a shallow copy, i.e. new object with same data.
        rp)r1rr�rrK�r�r9s  r��_viewzIndex._views9���!�!�$�,�,�T�Z�Z�d�FV�FV�!�W������
��
r�c�4�|j�}||_|S)zG
        fastpath for rename if new name is already validated.
        )rtr�)r�r�r9s   r��_renamez
Index._renames��
���������
r�c��||uryt|d�sy|j�|j�y|j|juS)a�
        More flexible, faster check like ``is`` but that works through views.

        Note: this is *not* the same as ``Index.identical()``, which checks
        that metadata is also the same.

        Parameters
        ----------
        other : object
            Other object to compare against.

        Returns
        -------
        bool
            True if both have same underlying data, False otherwise.

        See Also
        --------
        Index.identical : Works like ``Index.is_`` but also checks metadata.

        Examples
        --------
        >>> idx1 = pd.Index(['1', '2', '3'])
        >>> idx1.is_(idx1.view())
        True

        >>> idx1.is_(idx1.copy())
        False
        Tr�F)r%r��r�r�s  r��is_z	Index.is_sD��>�5�=�����&��
�X�X�
����!2���8�8�u�y�y�(�(r�c�"�t�|_y)zJ
        Initializes or resets ``_id`` attribute with new object.
        N)r�r�r�s r�rLzIndex._reset_identity?s
��
�8��r�c�8�|jj�yr�)�_engine�
clear_mappingr�s r��_cleanupzIndex._cleanupFs�����"�"�$r�c���|j�}t|jt�r�|jj
dvr�ddl}|jjj}|jj|�r9|jj�}tj|j�S|jj|�r9|jj!�}tj"|j�St|t$�rjt|t&tf�r#	t)|jj*|�S|j.tj0urtj2|�St5t6j8|�}|jt:k(rtj<|�S|jt6j>k(rtj@|�S|jt6jBk(rtjD|�StG|j�r|jHj}|j/|�S#t,$rY��wxYw)N�Mmr)%�_get_engine_targetrrror�r �pyarrow�	_pa_arrayrI�types�is_timestamp�_to_datetimearrayr��DatetimeEngine�_ndarray�is_duration�_to_timedeltaarray�TimedeltaEnginersrp�_masked_enginesr��KeyErrorr�r��ExtensionEnginer
rrr��
BoolEngine�	complex64�Complex64Engine�
complex128�Complex128EnginerQr�)r��
target_values�pa�pa_types    r�r|z
Index._engineJs���
�/�/�1�
��d�l�l�$7�8�T�Z�Z�_�_�PT�=T� ��l�l�,�,�1�1�G��x�x�$�$�W�-� $��� >� >� @�
��.�.�}�/E�/E�F�F����%�%�g�.� $��� ?� ?� A�
��/�/�
�0F�0F�G�G��m�^�4��-�/�;N�)O�P��*�=�+>�+>�+C�+C�D�]�S�S��"�"�h�&;�&;�;��/�/�
�>�>��R�Z�Z��7�
����$�&��&�&�}�5�5�
�
 �
 �B�L�L�
0��+�+�M�:�:�
�
 �
 �B�M�M�
1��,�,�]�;�;�
 ����
,�!�J�J�/�/�M�� � ��/�/��3 ����s�6!I+�+	I7�6I7c��|jd��dtd�D�chc]$}t|t�r|j	�r|��&c}Scc}w)z�
        Add the string-like labels to the owner dataframe/series dir output.

        If this is a MultiIndex, it's first level values are used.
        r�r�Nzdisplay.max_dir_items)r�rrr��isidentifier)r��cs  r��_dir_additions_for_ownerzIndex._dir_additions_for_owner{sU���[�[�q�[�)�*O�J�7N�,O�P�
�P���!�S�!�a�n�n�&6�
�P�
�	
��
s�)A
c�,�t|j�S)z1
        Return the length of the Index.
        )r,r�r�s r��__len__z
Index.__len__�s���4�:�:��r�c�D�tj|j|��S)z8
        The array interface, return my values.
        r)rr&r�)r�r�rs   r�rzIndex.__array__�s���z�z�$�*�*�E�2�2r�c���td�|D��rtStj�||g|��i|��}|tur|Sd|vrtj�||g|��i|��S|dk(r%tj
�||g|��i|��}|tur|S|D�cgc]}|�ur|n|j��}}t||�|i|��}|jdk(rt�fd�|D��S|dk(rtj|�}|S|jtjk(r|jtj �}�j#|�Scc}w)Nc3�HK�|]}t|ttf����y�wr�)rrcr])r
r�s  r�rz(Index.__array_ufunc__.<locals>.<genexpr>�s����P���z�%�)�\�!:�;��s� "rn�reducerc3�@�K�|]}�j|����y�wr�)�__array_wrap__)r
�xr�s  �r�rz(Index.__array_ufunc__.<locals>.<genexpr>�s�����@��A��,�,�Q�/����)�any�NotImplementedri�!maybe_dispatch_ufunc_to_dunder_op�dispatch_ufunc_with_out�dispatch_reduction_ufuncrr�noutr	r�item_from_zerodimr�rr?r�float32r�)r��ufunc�method�inputsrUr9r��
new_inputss`       r��__array_ufunc__zIndex.__array_ufunc__�sk����P��P�P�!�!��<�<��%��
�"(�
�,2�
����'��M��F�?��4�4��e�V��&,��06��
��X���7�7��e�V��&,��06��F��^�+��
�AG�H��A�1�D�=�a�a�i�i�7��
�H�'����'��>�v�>���:�:��?��@��@�@�@�
�x�
��*�*�6�2�F��M��<�<�2�:�:�%��]�]�2�:�:�.�F��"�"�6�*�*��Is�Ec���tj|�}t|t�st	|j
�st
j|�dkDr|St||j��S)zN
        Gets called after a ufunc and other functions e.g. np.split.
        r=rQ)	rr�rr�rEr�rr>r�)r�r9�context�
return_scalars    r�r�zIndex.__array_wrap__�sY��
�&�&�v�.���6�5�)�m�F�L�L�.I�b�g�g��O
�
�O��M��V�$�)�)�,�,r�c�.�|jjS)z�
        Return the dtype object of the underlying data.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx
        Index([1, 2, 3], dtype='int64')
        >>> idx.dtype
        dtype('int64')
        )r�r�r�s r�r�zIndex.dtype�s���z�z���r�c��|ddS)a\
        Return a view on self.

        Returns
        -------
        Index

        See Also
        --------
        numpy.ndarray.ravel : Return a flattened array.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3], index=['a', 'b', 'c'])
        >>> s.index.ravel()
        Index(['a', 'b', 'c'], dtype='object')
        N�)r��orders  r��ravelzIndex.ravel�s
��&�A�w�r�c�R�|��t|d�s�|}t|t�rt|�}t	|�rf|j|�}|jj|�}t|t�r(|j||j|j��S|S|jj|�}nM|�;tjdt|�j �d�t"t%���|j'�}t|t(�r|j*|_|S)Nr�rpzPassing a type in zr.view is deprecated and will raise in a future version. Call view without any argument to retain the old behavior.r)r%rr�rRrQr/r-�viewrsr1r�rr�r3r4rI�__name__r5r6rtr�r�)r�r�r��idx_clsr:r9s      r�r�z
Index.view�s���?�7�3��#7��E��#�s�#�$�S�)��"�5�)��1�1�%�8���j�j�o�o�e�,���c�>�2�"�.�.��$�)�)�$�2B�2B�/����
��Z�Z�_�_�S�)�F����
�
�(��d��)<�)<�(=�>Q�Q�"�/�1�
��Z�Z�\�F��f�e�$����F�J��
r�c��|�t|�}|j|k(r|r|j�S|S|j}t	|t
�rOt
t|�jt|�j�5|j||��}ddd�nCt	|t�r%|j�}|j|||��}nt|||��}t|j|jd��}|sN|j �Bt#|j|�r,|j |_|j j%|�|S#1swY�~xYw)a,
        Create an Index with values cast to dtypes.

        The class of a new Index is determined by dtype. When conversion is
        impossible, a TypeError exception is raised.

        Parameters
        ----------
        dtype : numpy dtype or pandas type
            Note that any signed integer `dtype` is treated as ``'int64'``,
            and any unsigned integer `dtype` is treated as ``'uint64'``,
            regardless of the size.
        copy : bool, default True
            By default, astype always returns a newly allocated object.
            If copy is set to False and internal requirements on dtype are
            satisfied, the original data is used to create a new Index
            or the original Index is returned.

        Returns
        -------
        Index
            Index with values cast to specified dtype.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx
        Index([1, 2, 3], dtype='int64')
        >>> idx.astype('float')
        Index([1.0, 2.0, 3.0], dtype='float64')
        NrrF)r�r�r)rRr�rr�rrsr7rIr�rrX�construct_array_type�_from_sequencer8r�r�rr9rM)r�r�rrN�
new_valuesr�r9s       r�rzIndex.astypes.��@�� ��'�E��:�:���"&�4�9�9�;�0�D�0������f�n�-�"�4��<�#8�#8�$�t�*�:M�:M�N�#�]�]�5�t�]�<�
�O�N���~�
.��,�,�.�C��+�+�D��D�+�I�J�&�f�E��E�J��z��	�	��9I�9I�PU�V���� � �,��t�z�z�5�1�!%�!1�!1�F�����2�2�6�:��
�-O�N�s�?E�Ea
        Return a new %(klass)s of the values selected by the indices.

        For internal compatibility with numpy arrays.

        Parameters
        ----------
        indices : array-like
            Indices to be taken.
        axis : int, optional
            The axis over which to select values, always 0.
        allow_fill : bool, default True
        fill_value : scalar, default None
            If allow_fill=True and fill_value is not None, indices specified by
            -1 are regarded as NA. If Index doesn't hold NA, raise ValueError.

        Returns
        -------
        Index
            An index formed of elements at the given indices. Will be the same
            type as self, except for RangeIndex.

        See Also
        --------
        numpy.ndarray.take: Return an array formed from the
            elements of a at the given indices.

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.take([2, 2, 1, 2])
        Index(['c', 'c', 'b', 'c'], dtype='object')
        �takec��|rtjd|�t|�rtd��t	|�}|j|||�}|j}t|tj�r$tj||||j��}n|j|||j��}|jj||j��S)Nr�z!Expected indices to be array-like)�
allow_fill�
fill_valuerQ)�nv�
validate_takerN�	TypeErrorrC�_maybe_disallow_fillrrrrrr��	_na_valuerXr1r�)r��indices�axisr�r�rUrN�takens        r�r�z
Index.takezs�������R��(��W���?�@�@�%�g�.���.�.�z�:�w�O�
������f�b�j�j�)��J�J���J�4�>�>��E�
�K�K��J�4�>�>� ��E�� � �,�,�U����,�C�Cr�c��|rR|�P|jr|dkj�r/td��t|�j}td|�d���|Sd}|S)zm
        We only use pandas-style take when allow_fill is True _and_
        fill_value is not None.
        ���zJWhen allow_fill=True and fill_value is not None, all indices must be >= -1zUnable to fill values because z cannot contain NAF)�_can_hold_nar�r.rIr�)r�r�r�r��cls_names     r�r�zIndex._maybe_disallow_fill�sw���*�0�� � ��b�L�%�%�'�$�4���
 ��:�.�.�� �4�X�J�>P�Q���
���J��r�a|
        Repeat elements of a %(klass)s.

        Returns a new %(klass)s where each element of the current %(klass)s
        is repeated consecutively a given number of times.

        Parameters
        ----------
        repeats : int or array of ints
            The number of repetitions for each element. This should be a
            non-negative integer. Repeating 0 times will return an empty
            %(klass)s.
        axis : None
            Must be ``None``. Has no effect but is accepted for compatibility
            with numpy.

        Returns
        -------
        %(klass)s
            Newly created %(klass)s with repeated elements.

        See Also
        --------
        Series.repeat : Equivalent function for Series.
        numpy.repeat : Similar method for :class:`numpy.ndarray`.

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx
        Index(['a', 'b', 'c'], dtype='object')
        >>> idx.repeat(2)
        Index(['a', 'a', 'b', 'b', 'c', 'c'], dtype='object')
        >>> idx.repeat([1, 2, 3])
        Index(['a', 'b', 'b', 'c', 'c', 'c'], dtype='object')
        �repeatc���t|�}tjdd|i�|jj	|�}|j
j
||j��S)Nr�r�rQ)rCr��validate_repeatrr�rXr1r�)r��repeatsr��
res_valuess    r�r�zIndex.repeat�sV��%�g�.��
���2���~�.��\�\�(�(��1�
�� � �,�,�Z�d�i�i�,�H�Hr�c���|j||��d}|r8|jj�}t|�j	||��}|S|j|��}|S)a�
        Make a copy of this object.

        Name is set on the new object.

        Parameters
        ----------
        name : Label, optional
            Set name for new object.
        deep : bool, default False

        Returns
        -------
        Index
            Index refer to new object which is a copy of this object.

        Notes
        -----
        In most cases, there should be no functional difference from using
        ``deep``, but if ``deep`` is passed it will attempt to deepcopy.

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> new_idx = idx.copy()
        >>> idx is new_idx
        False
        )r��deeprrQ)�_validate_namesr�rrIr1rv)r�r�r��new_data�	new_indexs     r�rz
Index.copy�sk��D�#�#��D�#�9�!�<����z�z���(�H��T�
�.�.�x�d�.�C�I������$��/�I��r�c�&�|jdi|��S)Nr�r)r�rUs  r��__copy__zIndex.__copy__s���t�y�y�"�6�"�"r�c�&�|jd��S)zq
        Parameters
        ----------
        memo, default None
            Standard signature. Unused
        T�r�r)r��memos  r��__deepcopy__zIndex.__deepcopy__s���y�y�d�y�#�#r�c���t|�j}|j�}|j�}|D��cgc]\}}|�d|����}}}dj	|�}|�d|�|�d�Scc}}w)zA
        Return a string representation for this object.
        �=�, �(�))rIr��_format_data�
_format_attrsr�)r��
klass_namer��attrs�k�v�	attrs_str�preprs        r��__repr__zIndex.__repr__s{��
�$�Z�(�(�
�� � �"���"�"�$��,1�2�E�D�A�q��s�!�A�3�Z�E�	�2��	�	�)�$����Q�t�f�U�G�1�-�-��3s�A*c��tS)z0
        Return the formatter function.
        )r�r�s r��_formatter_funczIndex._formatter_func*s
��
�r�c�$�d}|jdk(rd}nYt|jt�r.t	d|�}t|jj�rd}nt|t�ryt||j|||j��S)z@
        Return the formatted data as a unicode string.
        T�stringFr�r�)�
is_justifyr��line_break_each_value)�
inferred_typerr�rVr
rM�
categoriesrbr�r�rR)r�r�r�s   r�r�zIndex._format_data1s����
�����)��J�
��
�
�$4�
5��*�D�1�D��t���4�4�5�"�
�
��m�
,��$��� � �!��"&�.�.�
�	
r�c���g}|js!|jdd|j�d�f�|j�'|jdt	|j�f�nN|jrBtd�|jD��r&|jdt	|j�f�td�xst|�}t|�|kDr|jdt|�f�|S)zH
        Return a list of tuples of the (attr,formatted_value).
        r��'r�c3�$K�|]}|du���
y�wr�r��r
r�s  r�rz&Index._format_attrs.<locals>.<genexpr>Vs����#F�:�a�A�T�M�:�s�rzdisplay.max_seq_items�length)	rR�appendr�r�r�r�rrr,)r�r��
max_seq_itemss   r�r�zIndex._format_attrsKs���@B���~�~��L�L�'�Q�t�z�z�l�!�#4�5�6��9�9� ��L�L�&�.����";�<�=�
�^�^��#F�4�:�:�#F� F��L�L�'�>�$�*�*�#=�>�?�"�#:�;�H�s�4�y�
��t�9�}�$��L�L�(�C��I�.�/��r�c��|jr,t|j�D��cgc]\}}|�|n|��
c}}S|j�dS|jScc}}w)zX
        Return a name or list of names with None replaced by the level number.
        r)rR�	enumeraterr�)r�r�r�s   r��_get_level_nameszIndex._get_level_names^s]��
�>�>�CL�T�Z�Z�CX��CX�K�E�4����4�/�CX��
��	�	�)�1�8�t�y�y�8��	s�Ac��t|jtj�r=|jjdk7r$t	tj
|j�S|jtd��jS)NrBFr)
rr�rr r
rrNrr�rr�s r��	_mpl_reprzIndex._mpl_reprjsS���d�j�j�"�(�(�+��
�
���3�0F���
�
�D�K�K�0�0��{�{�6��{�.�6�6�6r��NaNc�J�tjt|�j�d�tt���g}|r4|j
|j�t|jd��nd�|�|t|j|��zS|j||��S)�>
        Render a string representation of the Index.
        z.format is deprecated and will be removed in a future version. Convert using index.astype(str) or index.map(formatter) instead.r��	�
rZ��escape_charsr���header�na_rep)r3r4rIr�r5r6r�r�r�r(�map�_format_with_header)r�r��	formatterrrs     r��formatzIndex.formatqs���	�
�
��D�z�"�"�#�$,�
,�
�'�)�
	
�����M�M��9�9�(��T�Y�Y�5G�H��
�� ��D����)�!4�5�5�5��'�'�v�f�'�E�Er�)rc���g}|r4|j|j�t|jd��nd�|�|t|j	|��zS|j||j��S)rrrr�r
)r�r�r�r(rr�_default_na_rep)r��include_namerrs    r��_format_flatzIndex._format_flat�ss������M�M��9�9�(��T�Y�Y�5G�H��
�� ��D����)�!4�5�5�5��'�'�v�d�>R�>R�'�S�Sr�c��ddlm}|j}t|j�s5t|j�s t
|jttf�rd}nd}||d|��}t|�}||zS)Nr)�format_arrayr)r�)�justify)
�pandas.io.formats.formatrrrMr�rPrrYrV�
trim_front)r�rrrrNr�	formattedr9s        r�rzIndex._format_with_header�sl��9�����
�F�L�L�)��v�|�|�,��$�*�*�}�6F�&G�H��G��G�!���w�?�	��I�&�����r�r��.�r�decimal�float_format�date_format�quotingc�8�t|j|||||��S)Nr)�get_values_for_csvr)r�rr r!r"r#s      r��_get_values_for_csvzIndex._get_values_for_csv�s'��"��L�L���%�#��

�	
r�c�(�t|�dkDr�|d}t|d�r!t|t�s|j	�}n6t|j�r!|j|�jdd�}|d}t|d�r!t|t�s|j	�}n6t|j�r!|j|�jdd�}d|�d|��}nd}|�t|�j}|�dt|��d	|��S)
a
        Return a summarized representation.

        Parameters
        ----------
        name : str
            name to use in the summary representation

        Returns
        -------
        String with a summarized representation of the index
        rrr�r�r�r�z to z: z entries)r,r%rr�rrQr�r��replacerIr�)r�r��head�tail�
index_summarys     r��_summaryzIndex._summary�s����t�9�q�=���7�D��t�X�&�z�$��/D��{�{�}��$�T�Z�Z�0��+�+�D�1�9�9�#�r�B����8�D��t�X�&�z�$��/D��{�{�}��$�T�Z�Z�0��+�+�D�1�9�9�#�r�B�� ���d�4�&�1�M��M��<���:�&�&�D���r�#�d�)��H�]�O�<�<r�c��|S)a+
        Identity method.

        This is implemented for compatibility with subclass implementations
        when chaining.

        Returns
        -------
        pd.Index
            Caller.

        See Also
        --------
        MultiIndex.to_flat_index : Subclass implementation.
        r�r�s r��
to_flat_indexzIndex.to_flat_index�s	�� �r�c��ddlm}|�|j�}|�|j}||jj�||��S)a�
        Create a Series with both index and values equal to the index keys.

        Useful with map for returning an indexer based on an index.

        Parameters
        ----------
        index : Index, optional
            Index of resulting Series. If None, defaults to original index.
        name : str, optional
            Name of resulting Series. If None, defaults to name of original
            index.

        Returns
        -------
        Series
            The dtype will be based on the type of the Index values.

        See Also
        --------
        Index.to_frame : Convert an Index to a DataFrame.
        Series.to_frame : Convert Series to DataFrame.

        Examples
        --------
        >>> idx = pd.Index(['Ant', 'Bear', 'Cow'], name='animal')

        By default, the original index and original name is reused.

        >>> idx.to_series()
        animal
        Ant      Ant
        Bear    Bear
        Cow      Cow
        Name: animal, dtype: object

        To enforce a new index, specify new labels to ``index``:

        >>> idx.to_series(index=[0, 1, 2])
        0     Ant
        1    Bear
        2     Cow
        Name: animal, dtype: object

        To override the name of the resulting column, specify ``name``:

        >>> idx.to_series(name='zoo')
        animal
        Ant      Ant
        Bear    Bear
        Cow      Cow
        Name: zoo, dtype: object
        rra)rr�)rHr�rtr�rr)r�rr�r�s    r��	to_serieszIndex.to_seriessB��n	"��=��J�J�L�E��<��9�9�D��d�l�l�'�'�)��T�B�Br�c��ddlm}|tjur|j	�}|||it���}|r||_|S)a�
        Create a DataFrame with a column containing the Index.

        Parameters
        ----------
        index : bool, default True
            Set the index of the returned DataFrame as the original Index.

        name : object, defaults to index.name
            The passed name should substitute for the index name (if it has
            one).

        Returns
        -------
        DataFrame
            DataFrame containing the original Index data.

        See Also
        --------
        Index.to_series : Convert an Index to a Series.
        Series.to_frame : Convert Series to DataFrame.

        Examples
        --------
        >>> idx = pd.Index(['Ant', 'Bear', 'Cow'], name='animal')
        >>> idx.to_frame()
               animal
        animal
        Ant       Ant
        Bear     Bear
        Cow       Cow

        By default, the original Index is reused. To enforce a new Index:

        >>> idx.to_frame(index=False)
            animal
        0   Ant
        1  Bear
        2   Cow

        To override the name of the resulting column, specify `name`:

        >>> idx.to_frame(index=False, name='zoo')
            zoo
        0   Ant
        1  Bear
        2   Cow
        r)r�r)rHr�rrrrr)r�rr�r�r9s     r�rmzIndex.to_frameGsH��f	%��3�>�>�!��(�(�*�D��D�$�<�2E�2G�.G�H����F�L��
r�c��|jS)z�
        Return Index or MultiIndex name.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3], name='x')
        >>> idx
        Index([1, 2, 3], dtype='int64',  name='x')
        >>> idx.name
        'x'
        )r�r�s r�r�z
Index.name�s���z�z�r�c�l�|jrtd��t|dt|��||_y)NzOCannot set name on a level of a MultiIndex. Use 'MultiIndex.set_names' instead.)r��RuntimeErrorrrIr�)r��values  r�r�z
Index.name�s6��� � ��2��
�	�5�$��T�
�3���
r�c��ddlm}|�
|�td��|�#|�!|r||j�n|j}n,|�t	|�std��|}nt	|�s|g}n|}t|�t|j�k7r-t
dt|j��dt|�����t|dt|�j�d�i�|S)	z�
        Handles the quirks of having a singular 'name' parameter for general
        Index and plural 'names' parameter for MultiIndex.
        r)�deepcopyz*Can only provide one of `names` and `name`�Must pass list-like as `names`.zLength of new names must be z, got �
error_name�.name)
rr7r�rrKr,r.rSrIr�)r�r�rr�r7�	new_namess      r�r�zIndex._validate_names�s���	"����!1��H�I�I��=�T�\�04�����,�$�*�*�I�
�
���&�� A�B�B��I��d�#���I��I��y�>�S����_�,��.�s�4�:�:��.?�v�c�)�n�EU�V��
�
	�y�S��T�
�8K�8K�7L�E�5R�S��r�c��ddlm}|�t|ttf�r|g}t|t
�s
|�t
d��|sIt||�r!tj|j�}|S|j�|gn|jg}|S)a=
        Get names of index.

        Parameters
        ----------
        names : int, str or 1-dimensional list, default None
            Index names to set.
        default : str
            Default name of index.

        Raises
        ------
        TypeError
            if names not str or list-like
        rrz-Index names must be str or 1-dimensional list)r*r�r�intr�r(r.r!�fill_missing_namesrr�)r�r�defaultr�s    r��_get_default_index_nameszIndex._get_default_index_names�s���$	9����%�#�s��,�����%��&�5�+<��L�M�M���$�
�+��.�.�t�z�z�:����&*�Y�Y�%6��	�T�Y�Y�K���r�c�.�t|jf�Sr�)r~r�r�s r��
_get_nameszIndex._get_names�s���4�9�9�,�'�'r�r�c���t|�std��t|�dk7rtdt|�����t|dt	|�j
�d�i�|d|_y)a�
        Set new names on index. Each name has to be a hashable type.

        Parameters
        ----------
        values : str or sequence
            name(s) to set
        level : int, level name, or sequence of int/level names (default None)
            If the index is a MultiIndex (hierarchical), level(s) to set (None
            for all levels).  Otherwise level must be None

        Raises
        ------
        TypeError if each name is not hashable.
        zNames must be a list-liker=z#Length of new names must be 1, got r9r:rN)rKr.r,rSrIr�r��r�rNr�s   r��
_set_nameszIndex._set_names�sg�� �F�#��8�9�9��v�;�!���B�3�v�;�-�P�Q�Q�	�v�P�T�$�Z�5H�5H�4I��2O�P��A�Y��
r�)�fset�fget.)r�r�c��yr�r��r�rr�r�s    r��	set_nameszIndex.set_names���r�c��yr�r�rIs    r�rJzIndex.set_names	rKr�c��yr�r�rIs    r�rJzIndex.set_names
rKr�c���|�t|t�std��|�!t|�st|�rt	d��t|�s|�|j
dkDrt	d��t
|�rt|t�st	d��t
|�r
|�t	d��t|t�rht
|�r]|�[gg}}t|j�D]=\}}||j�vs�|j|�|j||��?|}t|�s|g}|�t|�s|g}|r|}n|j�}|j||��|s|Sy)	a�
        Set Index or MultiIndex name.

        Able to set new names partially and by level.

        Parameters
        ----------

        names : label or list of label or dict-like for MultiIndex
            Name(s) to set.

            .. versionchanged:: 1.3.0

        level : int, label or list of int or label, optional
            If the index is a MultiIndex and names is not dict-like, level(s) to set
            (None for all levels). Otherwise level must be None.

            .. versionchanged:: 1.3.0

        inplace : bool, default False
            Modifies the object directly, instead of creating a new Index or
            MultiIndex.

        Returns
        -------
        Index or None
            The same type as the caller or None if ``inplace=True``.

        See Also
        --------
        Index.rename : Able to set new names without level.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3, 4])
        >>> idx
        Index([1, 2, 3, 4], dtype='int64')
        >>> idx.set_names('quarter')
        Index([1, 2, 3, 4], dtype='int64', name='quarter')

        >>> idx = pd.MultiIndex.from_product([['python', 'cobra'],
        ...                                   [2018, 2019]])
        >>> idx
        MultiIndex([('python', 2018),
                    ('python', 2019),
                    ( 'cobra', 2018),
                    ( 'cobra', 2019)],
                   )
        >>> idx = idx.set_names(['kind', 'year'])
        >>> idx.set_names('species', level=0)
        MultiIndex([('python', 2018),
                    ('python', 2019),
                    ( 'cobra', 2018),
                    ( 'cobra', 2019)],
                   names=['species', 'year'])

        When renaming levels with a dict, levels can not be passed.

        >>> idx.set_names({'kind': 'snake'})
        MultiIndex([('python', 2018),
                    ('python', 2019),
                    ( 'cobra', 2018),
                    ( 'cobra', 2019)],
                   names=['snake', 'year'])
        Nz%Level must be None for non-MultiIndexz7Names must be a string when a single level is provided.r=r8z2Can only pass dict-like as `names` for MultiIndex.z(Can not pass level for dictlike `names`.r�)
rr`r.rKr�rkrerr�keysr�rtrE)r�rr�r��names_adjusted�ir��idxs        r�rJzIndex.set_namessQ��D��Z��m�%D��D�E�E���\�%�%8�\�%�=P��U�V�V��E�"�u�}�����9I��=�>�>����z�$�
�'F��P�Q�Q����5�#4��F�G�G��d�M�*�|�E�/B�u�}�$&��>�E�$�T�Z�Z�0���4��5�:�:�<�'��L�L��O�"�)�)�%��+�6�1�#�E��E�"��G�E���\�%�%8��G�E���C��*�*�,�C����u�E��*���J�r��r�c��yr�r��r�r�r�s   r��renamezIndex.renamezrKr�c��yr�r�rUs   r�rVzIndex.rename~rKr�z3.0r�rV)�version�allowed_argsr�c�*�|j|g|��S)aq
        Alter Index or MultiIndex name.

        Able to set new names without level. Defaults to returning new index.
        Length of names must match number of levels in MultiIndex.

        Parameters
        ----------
        name : label or list of labels
            Name(s) to set.
        inplace : bool, default False
            Modifies the object directly, instead of creating a new Index or
            MultiIndex.

        Returns
        -------
        Index or None
            The same type as the caller or None if ``inplace=True``.

        See Also
        --------
        Index.set_names : Able to set new names partially and by level.

        Examples
        --------
        >>> idx = pd.Index(['A', 'C', 'A', 'B'], name='score')
        >>> idx.rename('grade')
        Index(['A', 'C', 'A', 'B'], dtype='object', name='grade')

        >>> idx = pd.MultiIndex.from_product([['python', 'cobra'],
        ...                                   [2018, 2019]],
        ...                                   names=['kind', 'year'])
        >>> idx
        MultiIndex([('python', 2018),
                    ('python', 2019),
                    ( 'cobra', 2018),
                    ( 'cobra', 2019)],
                   names=['kind', 'year'])
        >>> idx.rename(['species', 'year'])
        MultiIndex([('python', 2018),
                    ('python', 2019),
                    ( 'cobra', 2018),
                    ( 'cobra', 2019)],
                   names=['species', 'year'])
        >>> idx.rename('species')
        Traceback (most recent call last):
        TypeError: Must pass list-like as `names`.
        rS)rJrUs   r�rVzIndex.rename�s��h�~�~�t�f�g�~�6�6r�c��y)z#
        Number of levels.
        r=r�r�s r�rkz
Index.nlevels�s��
r�c��|S)z)
        Compat with MultiIndex.
        r�r�s r��_sort_levels_monotoniczIndex._sort_levels_monotonic�s	���r�c���t|t�r0|dkr|dk7rtd|�d���|dkDrtd|dz����y
||jk7rt	d|�d|j�d	���y
)z�
        Validate index level.

        For single-level Index getting level number is a no-op, but some
        verification must be done like in MultiIndex.

        rr�z)Too many levels: Index has only 1 level, z is not a valid level numberz-Too many levels: Index has only 1 level, not r=zRequested level (z) does not match index name (r�N)rr=�
IndexErrorr�r��r�r�s  r��_validate_index_levelzIndex._validate_index_level�s����e�S�!��q�y�U�b�[� �?��g�9�;����q�y� �C�E�A�I�;�O�����d�i�i�
��#�E�7�*G��	�	�{�RS�T��
� r�c�&�|j|�y)Nr�rar`s  r��_get_level_numberzIndex._get_level_number�s���"�"�5�)�r�rbc��t|ttf�std��t|t�rt	|�dk7rtd��|d}t|t�std��|jd||��S)a
        For internal compatibility with the Index API.

        Sort the Index. This is for compat with MultiIndex

        Parameters
        ----------
        ascending : bool, default True
            False to sort in descending order
        na_position : {'first' or 'last'}, default 'first'
            Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
            the end.

            .. versionadded:: 2.1.0

        level, sort_remaining are compat parameters

        Returns
        -------
        Index
        zIascending must be a single bool value ora list of bool values of length 1r=z3ascending must be a list of bool values of length 1rzascending must be a bool valueT)�return_indexer�	ascending�na_position)rr(r�r�r,�sort_values)r�r�rg�sort_remainingrhs     r��	sortlevelzIndex.sortlevel�s���8�)�d�D�\�2��4��
�
�i��&��9�~��"�� U�V�V�!�!��I��)�T�*��<�=�=�����9�+� �
�	
r�c�(�|j|�|S)a�
        Return an Index of values for requested level.

        This is primarily useful to get an individual level of values from a
        MultiIndex, but is provided on Index as well for compatibility.

        Parameters
        ----------
        level : int or str
            It is either the integer position or the name of the level.

        Returns
        -------
        Index
            Calling object, as there is only one level in the Index.

        See Also
        --------
        MultiIndex.get_level_values : Get values for a level of a MultiIndex.

        Notes
        -----
        For Index, level should be 0, since there are no multiple levels.

        Examples
        --------
        >>> idx = pd.Index(list('abc'))
        >>> idx
        Index(['a', 'b', 'c'], dtype='object')

        Get level values by supplying `level` as integer:

        >>> idx.get_level_values(0)
        Index(['a', 'b', 'c'], dtype='object')
        rcr`s  r��_get_level_valueszIndex._get_level_valuess��H	
�"�"�5�)��r�c���t|ttf�s|g}t�fd�|D��ddd�}�j	|�S)a�
        Return index with requested level(s) removed.

        If resulting index has only 1 level left, the result will be
        of Index type, not MultiIndex. The original index is not modified inplace.

        Parameters
        ----------
        level : int, str, or list-like, default 0
            If a string is given, must be the name of a level
            If list-like, elements must be names or indexes of levels.

        Returns
        -------
        Index or MultiIndex

        Examples
        --------
        >>> mi = pd.MultiIndex.from_arrays(
        ... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'])
        >>> mi
        MultiIndex([(1, 3, 5),
                    (2, 4, 6)],
                   names=['x', 'y', 'z'])

        >>> mi.droplevel()
        MultiIndex([(3, 5),
                    (4, 6)],
                   names=['y', 'z'])

        >>> mi.droplevel(2)
        MultiIndex([(1, 3),
                    (2, 4)],
                   names=['x', 'y'])

        >>> mi.droplevel('z')
        MultiIndex([(1, 3),
                    (2, 4)],
                   names=['x', 'y'])

        >>> mi.droplevel(['x', 'y'])
        Index([5, 6], dtype='int64', name='z')
        c3�@�K�|]}�j|����y�wr�)rd)r
�levr�s  �r�rz"Index.droplevel.<locals>.<genexpr>ks�����F����/�/��4��r�Nr�)rr	r(�sorted�_drop_level_numbers)r�r��levnumss`  r��	droplevelzIndex.droplevel;sE���Z�%�%���/��G�E��F��F�F�t��t�L���'�'��0�0r�c��|st|t�s|St|�|jk\r%t	dt|��d|j�d���td|�}t
|j�}t
|j�}t
|j�}|D]5}|j|�|j|�|j|��7t|�dk(r�|d}t|�dk(r_t|d�dk(r|dd}|Stj|j|dd�	�}|jj||d�
�}|S|ddk(}	|dj|d�}|	j!�r |j#|	t$j&�}|d|_|Sddlm}
|
|||d
��S)zE
        Drop MultiIndex levels by level _number_, not name.
        zCannot remove z levels from an index with z) levels: at least one level must be left.r�r=rNT)r�rQr�rF��levelsr�rr�)rr`r,rkr.r
r(rwr�rr�rr�rrXr1r��putmaskr�nanr�r*r�)r�rs�
new_levels�	new_codesr;rQrpr9r��maskr�s           r�rrzIndex._drop_level_numbersos����z�$�
�>��K��w�<�4�<�<�'�� ��W���.I��<�<�.� I�K��
�
�L�$�'���$�+�+�&�
�����$�	�����$�	��A��N�N�1���M�M�!���M�M�!���
�z�?�a���Q�-�C��3�x�1�}��y��|�$��)�!��!�W�F��M�"'���C�K�K��1��RV�!W�J� �-�-�9�9�*�9�UV�<�9�X�F��M�!��|�r�)��#�A��+�+�I�a�L�9���8�8�:�#�^�^�D�"�&�&�9�F�(��|����M�<��!���!&�	�
r�c��t|jt�r|jjS|jjdvryy)N�iubFT)rr�rXr�r r�s r�r�zIndex._can_hold_na�s8���d�j�j�.�1��:�:�*�*�*��:�:�?�?�e�#��r�c�.�|jjS)a�
        Return a boolean if the values are equal or increasing.

        Returns
        -------
        bool

        See Also
        --------
        Index.is_monotonic_decreasing : Check if the values are equal or decreasing.

        Examples
        --------
        >>> pd.Index([1, 2, 3]).is_monotonic_increasing
        True
        >>> pd.Index([1, 2, 2]).is_monotonic_increasing
        True
        >>> pd.Index([1, 3, 2]).is_monotonic_increasing
        False
        )r|�is_monotonic_increasingr�s r�r�zIndex.is_monotonic_increasing����,�|�|�3�3�3r�c�.�|jjS)a�
        Return a boolean if the values are equal or decreasing.

        Returns
        -------
        bool

        See Also
        --------
        Index.is_monotonic_increasing : Check if the values are equal or increasing.

        Examples
        --------
        >>> pd.Index([3, 2, 1]).is_monotonic_decreasing
        True
        >>> pd.Index([3, 2, 2]).is_monotonic_decreasing
        True
        >>> pd.Index([3, 1, 2]).is_monotonic_decreasing
        False
        )r|�is_monotonic_decreasingr�s r�r�zIndex.is_monotonic_decreasing�r�r�c�6�|jxr|jS)aq
        Return if the index is strictly monotonic increasing
        (only increasing) values.

        Examples
        --------
        >>> Index([1, 2, 3])._is_strictly_monotonic_increasing
        True
        >>> Index([1, 2, 2])._is_strictly_monotonic_increasing
        False
        >>> Index([1, 3, 2])._is_strictly_monotonic_increasing
        False
        )r[r�r�s r��!_is_strictly_monotonic_increasingz'Index._is_strictly_monotonic_increasing���� �~�~�>�$�">�">�>r�c�6�|jxr|jS)aq
        Return if the index is strictly monotonic decreasing
        (only decreasing) values.

        Examples
        --------
        >>> Index([3, 2, 1])._is_strictly_monotonic_decreasing
        True
        >>> Index([3, 2, 2])._is_strictly_monotonic_decreasing
        False
        >>> Index([3, 1, 2])._is_strictly_monotonic_decreasing
        False
        )r[r�r�s r��!_is_strictly_monotonic_decreasingz'Index._is_strictly_monotonic_decreasing�r�r�c�.�|jjS)a�
        Return if the index has unique values.

        Returns
        -------
        bool

        See Also
        --------
        Index.has_duplicates : Inverse method that checks if it has duplicate values.

        Examples
        --------
        >>> idx = pd.Index([1, 5, 7, 7])
        >>> idx.is_unique
        False

        >>> idx = pd.Index([1, 5, 7])
        >>> idx.is_unique
        True

        >>> idx = pd.Index(["Watermelon", "Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.is_unique
        False

        >>> idx = pd.Index(["Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.is_unique
        True
        )r|r[r�s r�r[zIndex.is_unique		s��B�|�|�%�%�%r�c��|jS)a#
        Check if the Index has duplicate values.

        Returns
        -------
        bool
            Whether or not the Index has duplicate values.

        See Also
        --------
        Index.is_unique : Inverse method that checks if it has unique values.

        Examples
        --------
        >>> idx = pd.Index([1, 5, 7, 7])
        >>> idx.has_duplicates
        True

        >>> idx = pd.Index([1, 5, 7])
        >>> idx.has_duplicates
        False

        >>> idx = pd.Index(["Watermelon", "Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.has_duplicates
        True

        >>> idx = pd.Index(["Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.has_duplicates
        False
        �r[r�s r��has_duplicateszIndex.has_duplicates,	s��F�>�>�!�!r�c��tjt|�j�d�tt���|jdvS)ah
        Check if the Index only consists of booleans.

        .. deprecated:: 2.0.0
            Use `pandas.api.types.is_bool_dtype` instead.

        Returns
        -------
        bool
            Whether or not the Index only consists of booleans.

        See Also
        --------
        is_integer : Check if the Index only consists of integers (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_object : Check if the Index is of the object dtype (deprecated).
        is_categorical : Check if the Index holds categorical data.
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index([True, False, True])
        >>> idx.is_boolean()  # doctest: +SKIP
        True

        >>> idx = pd.Index(["True", "False", "True"])
        >>> idx.is_boolean()  # doctest: +SKIP
        False

        >>> idx = pd.Index([True, False, "True"])
        >>> idx.is_boolean()  # doctest: +SKIP
        False
        zE.is_boolean is deprecated. Use pandas.api.types.is_bool_type instead.r)r��r3r4rIr�r5r6r�r�s r��
is_booleanzIndex.is_booleanQ	sG��H	�
�
��D�z�"�"�#�$9�
9��'�)�		
��!�!�[�0�0r�c��tjt|�j�d�tt���|jdvS)ax
        Check if the Index only consists of integers.

        .. deprecated:: 2.0.0
            Use `pandas.api.types.is_integer_dtype` instead.

        Returns
        -------
        bool
            Whether or not the Index only consists of integers.

        See Also
        --------
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_object : Check if the Index is of the object dtype. (deprecated).
        is_categorical : Check if the Index holds categorical data (deprecated).
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3, 4])
        >>> idx.is_integer()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
        >>> idx.is_integer()  # doctest: +SKIP
        False

        >>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
        >>> idx.is_integer()  # doctest: +SKIP
        False
        zI.is_integer is deprecated. Use pandas.api.types.is_integer_dtype instead.r)�integerr�r�s r�rIzIndex.is_integer}	sG��H	�
�
��D�z�"�"�#�$=�
=��'�)�		
��!�!�[�0�0r�c��tjt|�j�d�tt���|jdvS)a�
        Check if the Index is a floating type.

        .. deprecated:: 2.0.0
            Use `pandas.api.types.is_float_dtype` instead

        The Index may consist of only floats, NaNs, or a mix of floats,
        integers, or NaNs.

        Returns
        -------
        bool
            Whether or not the Index only consists of only consists of floats, NaNs, or
            a mix of floats, integers, or NaNs.

        See Also
        --------
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_integer : Check if the Index only consists of integers (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_object : Check if the Index is of the object dtype. (deprecated).
        is_categorical : Check if the Index holds categorical data (deprecated).
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
        >>> idx.is_floating()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1.0, 2.0, np.nan, 4.0])
        >>> idx.is_floating()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4, np.nan])
        >>> idx.is_floating()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4])
        >>> idx.is_floating()  # doctest: +SKIP
        False
        zH.is_floating is deprecated. Use pandas.api.types.is_float_dtype instead.r)�floatingzmixed-integer-floatz
integer-nar�r�s r��is_floatingzIndex.is_floating�	sH��X	�
�
��D�z�"�"�#�$;�
;��'�)�		
��!�!�%V�V�Vr�c��tjt|�j�d�tt���|jdvS)aR
        Check if the Index only consists of numeric data.

        .. deprecated:: 2.0.0
            Use `pandas.api.types.is_numeric_dtype` instead.

        Returns
        -------
        bool
            Whether or not the Index only consists of numeric data.

        See Also
        --------
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_integer : Check if the Index only consists of integers (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_object : Check if the Index is of the object dtype. (deprecated).
        is_categorical : Check if the Index holds categorical data (deprecated).
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
        >>> idx.is_numeric()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4.0])
        >>> idx.is_numeric()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4])
        >>> idx.is_numeric()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4.0, np.nan])
        >>> idx.is_numeric()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 2, 3, 4.0, np.nan, "Apple"])
        >>> idx.is_numeric()  # doctest: +SKIP
        False
        zQ.is_numeric is deprecated. Use pandas.api.types.is_any_real_numeric_dtype insteadr)r�r�r�r�s r��
is_numericzIndex.is_numeric�	sJ��X	�
�
��D�z�"�"�#�$E�
E��'�)�		
��!�!�%<�<�<r�c��tjt|�j�d�tt���t
|j�S)a2
        Check if the Index is of the object dtype.

        .. deprecated:: 2.0.0
           Use `pandas.api.types.is_object_dtype` instead.

        Returns
        -------
        bool
            Whether or not the Index is of the object dtype.

        See Also
        --------
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_integer : Check if the Index only consists of integers (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_categorical : Check if the Index holds categorical data (deprecated).
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
        >>> idx.is_object()  # doctest: +SKIP
        True

        >>> idx = pd.Index(["Apple", "Mango", 2.0])
        >>> idx.is_object()  # doctest: +SKIP
        True

        >>> idx = pd.Index(["Watermelon", "Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.is_object()  # doctest: +SKIP
        False

        >>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
        >>> idx.is_object()  # doctest: +SKIP
        False
        zE.is_object is deprecated.Use pandas.api.types.is_object_dtype insteadr)r3r4rIr�r5r6rMr�r�s r��	is_objectzIndex.is_object
sE��R	�
�
��D�z�"�"�#�$;�
;��'�)�		
��t�z�z�*�*r�c��tjt|�j�d�tt���|jdvS)a�
        Check if the Index holds categorical data.

        .. deprecated:: 2.0.0
              Use `isinstance(index.dtype, pd.CategoricalDtype)` instead.

        Returns
        -------
        bool
            True if the Index is categorical.

        See Also
        --------
        CategoricalIndex : Index for categorical data.
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_integer : Check if the Index only consists of integers (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_object : Check if the Index is of the object dtype. (deprecated).
        is_interval : Check if the Index holds Interval objects (deprecated).

        Examples
        --------
        >>> idx = pd.Index(["Watermelon", "Orange", "Apple",
        ...                 "Watermelon"]).astype("category")
        >>> idx.is_categorical()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 3, 5, 7])
        >>> idx.is_categorical()  # doctest: +SKIP
        False

        >>> s = pd.Series(["Peter", "Victor", "Elisabeth", "Mar"])
        >>> s
        0        Peter
        1       Victor
        2    Elisabeth
        3          Mar
        dtype: object
        >>> s.index.is_categorical()  # doctest: +SKIP
        False
        zO.is_categorical is deprecated.Use pandas.api.types.is_categorical_dtype insteadr)�categoricalr�r�s r��is_categoricalzIndex.is_categoricalB
sI��X	�
�
��D�z�"�"�#�$@�
@��'�)�		
��!�!�_�4�4r�c��tjt|�j�d�tt���|jdvS)a|
        Check if the Index holds Interval objects.

        .. deprecated:: 2.0.0
            Use `isinstance(index.dtype, pd.IntervalDtype)` instead.

        Returns
        -------
        bool
            Whether or not the Index holds Interval objects.

        See Also
        --------
        IntervalIndex : Index for Interval objects.
        is_boolean : Check if the Index only consists of booleans (deprecated).
        is_integer : Check if the Index only consists of integers (deprecated).
        is_floating : Check if the Index is a floating type (deprecated).
        is_numeric : Check if the Index only consists of numeric data (deprecated).
        is_object : Check if the Index is of the object dtype. (deprecated).
        is_categorical : Check if the Index holds categorical data (deprecated).

        Examples
        --------
        >>> idx = pd.Index([pd.Interval(left=0, right=5),
        ...                 pd.Interval(left=5, right=10)])
        >>> idx.is_interval()  # doctest: +SKIP
        True

        >>> idx = pd.Index([1, 3, 5, 7])
        >>> idx.is_interval()  # doctest: +SKIP
        False
        zI.is_interval is deprecated.Use pandas.api.types.is_interval_dtype insteadr)�intervalr�r�s r��is_intervalzIndex.is_intervalw
sG��D	�
�
��D�z�"�"�#�$=�
=��'�)�		
��!�!�\�1�1r�c��|jdvS)z6
        Whether the type is an integer type.
        )r�r��r�r�s r��_holds_integerzIndex._holds_integer�
s��
�!�!�%A�A�Ar�c��tjt|�j�d�tt���|j
�S)z�
        Whether the type is an integer type.

        .. deprecated:: 2.0.0
            Use `pandas.api.types.infer_dtype` instead
        zG.holds_integer is deprecated. Use pandas.api.types.infer_dtype instead.r)r3r4rIr�r5r6r�r�s r��
holds_integerzIndex.holds_integer�
sD��	�
�
��D�z�"�"�#�$8�
8��'�)�		
��"�"�$�$r�c�D�tj|jd��S)z�
        Return a string of the type inferred from the values.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx
        Index([1, 2, 3], dtype='int64')
        >>> idx.inferred_type
        'integer'
        F��skipna)r�infer_dtyperr�s r�r�zIndex.inferred_type�
s�����t�|�|�E�:�:r�c��t|j�ry|jtk7ry|jryt	t|j��S)zH
        Whether or not the index values only consist of dates.
        TF)rQr�r#rRrrBrr�s r��
_is_all_dateszIndex._is_all_dates�
sB���t�z�z�*��
�Z�Z�:�
%��
�^�^�� ��t�|�|�!<�=�=r�c�"�t|t�S)zI
        Cached check equivalent to isinstance(self, MultiIndex)
        )rr`r�s r�rRzIndex._is_multi�
s���$�
�.�.r�c�\�|j|jd�}tt|�|fdfS)N)r�r�)r�r�r�rI)r�r�s  r��
__reduce__zIndex.__reduce__�
s)���Z�Z����3���D��J��?�D�0�0r�c��|j}t|tj�r$|jdvrtStj
S|jS)z-The expected NA value to use with this index.�mM)r�rrr rry�na_value�r�r�s  r�r�zIndex._na_value�
s?���
�
���e�R�X�X�&��z�z�T�!��
��6�6�M��~�~�r�c��|jrt|�Stjt	|�tj
��}|j
d�|S)z.
        Return if each value is NaN.
        rF)r�rhr�emptyr,�bool_�fill)r�rNs  r��_isnanzIndex._isnan�
sB��
�����:���X�X�c�$�i�r�x�x�8�F��K�K����Mr�c�b�|jr#t|jj��Sy)aj
        Return True if there are any NaNs.

        Enables various performance speedups.

        Returns
        -------
        bool

        Examples
        --------
        >>> s = pd.Series([1, 2, 3], index=['a', 'b', None])
        >>> s
        a    1
        b    2
        None 3
        dtype: int64
        >>> s.index.hasnans
        True
        F)r�r�r�r�r�s r��hasnansz
Index.hasnanss&��,���������)�*�*�r�c��|jS)a�
        Detect missing values.

        Return a boolean same-sized object indicating if the values are NA.
        NA values, such as ``None``, :attr:`numpy.NaN` or :attr:`pd.NaT`, get
        mapped to ``True`` values.
        Everything else get mapped to ``False`` values. Characters such as
        empty strings `''` or :attr:`numpy.inf` are not considered NA values.

        Returns
        -------
        numpy.ndarray[bool]
            A boolean array of whether my values are NA.

        See Also
        --------
        Index.notna : Boolean inverse of isna.
        Index.dropna : Omit entries with missing values.
        isna : Top-level isna.
        Series.isna : Detect missing values in Series object.

        Examples
        --------
        Show which entries in a pandas.Index are NA. The result is an
        array.

        >>> idx = pd.Index([5.2, 6.0, np.nan])
        >>> idx
        Index([5.2, 6.0, nan], dtype='float64')
        >>> idx.isna()
        array([False, False,  True])

        Empty strings are not considered NA values. None is considered an NA
        value.

        >>> idx = pd.Index(['black', '', 'red', None])
        >>> idx
        Index(['black', '', 'red', None], dtype='object')
        >>> idx.isna()
        array([False, False, False,  True])

        For datetimes, `NaT` (Not a Time) is considered as an NA value.

        >>> idx = pd.DatetimeIndex([pd.Timestamp('1940-04-25'),
        ...                         pd.Timestamp(''), None, pd.NaT])
        >>> idx
        DatetimeIndex(['1940-04-25', 'NaT', 'NaT', 'NaT'],
                      dtype='datetime64[ns]', freq=None)
        >>> idx.isna()
        array([False,  True,  True,  True])
        )r�r�s r�rhz
Index.isnas��j�{�{�r�c�$�|j�S)a�
        Detect existing (non-missing) values.

        Return a boolean same-sized object indicating if the values are not NA.
        Non-missing values get mapped to ``True``. Characters such as empty
        strings ``''`` or :attr:`numpy.inf` are not considered NA values.
        NA values, such as None or :attr:`numpy.NaN`, get mapped to ``False``
        values.

        Returns
        -------
        numpy.ndarray[bool]
            Boolean array to indicate which entries are not NA.

        See Also
        --------
        Index.notnull : Alias of notna.
        Index.isna: Inverse of notna.
        notna : Top-level notna.

        Examples
        --------
        Show which entries in an Index are not NA. The result is an
        array.

        >>> idx = pd.Index([5.2, 6.0, np.nan])
        >>> idx
        Index([5.2, 6.0, nan], dtype='float64')
        >>> idx.notna()
        array([ True,  True, False])

        Empty strings are not considered NA values. None is considered a NA
        value.

        >>> idx = pd.Index(['black', '', 'red', None])
        >>> idx
        Index(['black', '', 'red', None], dtype='object')
        >>> idx.notna()
        array([ True,  True,  True, False])
        )rhr�s r��notnazIndex.notnaUs��T�	�	��|�r�c���t|�s!tdt|�j����|tj
ur<t
jdt|�j�d�tt���nd}|jr`|j|j|�}|�!tj||j��St!t|�j�d���|j#�S)a\
        Fill NA/NaN values with the specified value.

        Parameters
        ----------
        value : scalar
            Scalar value to use to fill holes (e.g. 0).
            This value cannot be a list-likes.
        downcast : dict, default is None
            A dict of item->dtype of what to downcast if possible,
            or the string 'infer' which will try to downcast to an appropriate
            equal type (e.g. float64 to int64 if possible).

            .. deprecated:: 2.1.0

        Returns
        -------
        Index

        See Also
        --------
        DataFrame.fillna : Fill NaN values of a DataFrame.
        Series.fillna : Fill NaN Values of a Series.

        Examples
        --------
        >>> idx = pd.Index([np.nan, np.nan, 3])
        >>> idx.fillna(0)
        Index([0.0, 0.0, 3.0], dtype='float64')
        z"'value' must be a scalar, passed: zThe 'downcast' keyword in zb.fillna is deprecated and will be removed in a future version. It was previously silently ignored.rNrQzF.fillna does not support 'downcast' argument values other than 'None'.)rNr�rIr�rrr3r4r5r6r�rxr�r�rVr�r@rt)r�r5�downcastr9s    r��fillnazIndex.fillna�s���>����@��e��AU�AU�@V�W�X�X��3�>�>�)��M�M�,�T�$�Z�-@�-@�,A�B6�6��+�-�
��H��<�<��\�\�$�+�+�u�5�F����(�(��d�i�i�(�@�@�%���:�&�&�'�(5�5��
��z�z�|�r�c���|dvrtd|����|jr@|j|j}t	|�j||j��S|j�S)a�
        Return Index without NA/NaN values.

        Parameters
        ----------
        how : {'any', 'all'}, default 'any'
            If the Index is a MultiIndex, drop the value when any or all levels
            are NaN.

        Returns
        -------
        Index

        Examples
        --------
        >>> idx = pd.Index([1, np.nan, 3])
        >>> idx.dropna()
        Index([1.0, 3.0], dtype='float64')
        )r�r)zinvalid how option: rQ)r.r�rr�rIr1r�rt)r�r�r�s   r��dropnazIndex.dropna�sd��(�n�$��3�C�5�9�:�:��<�<����t�{�{�l�3�J���:�)�)�*�4�9�9�)�E�E��z�z�|�r�c���|�|j|�|jr|j�St�|��}|j|�S)a�
        Return unique values in the index.

        Unique values are returned in order of appearance, this does NOT sort.

        Parameters
        ----------
        level : int or hashable, optional
            Only return values from specified level (for MultiIndex).
            If int, gets the level by integer position, else by level name.

        Returns
        -------
        Index

        See Also
        --------
        unique : Numpy array of unique values in that column.
        Series.unique : Return unique values of Series object.

        Examples
        --------
        >>> idx = pd.Index([1, 1, 2, 3, 3])
        >>> idx.unique()
        Index([1, 2, 3], dtype='int64')
        )rar[rt�superr�rq)r�r�r9�	__class__s   �r�r�zIndex.unique�sI���6���&�&�u�-��>�>��:�:�<�����!���!�!�&�)�)r�rcc�\��|jr|j�St�|�
|��S)a
        Return Index with duplicate values removed.

        Parameters
        ----------
        keep : {'first', 'last', ``False``}, default 'first'
            - 'first' : Drop duplicates except for the first occurrence.
            - 'last' : Drop duplicates except for the last occurrence.
            - ``False`` : Drop all duplicates.

        Returns
        -------
        Index

        See Also
        --------
        Series.drop_duplicates : Equivalent method on Series.
        DataFrame.drop_duplicates : Equivalent method on DataFrame.
        Index.duplicated : Related method on Index, indicating duplicate
            Index values.

        Examples
        --------
        Generate an pandas.Index with duplicate values.

        >>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama', 'hippo'])

        The `keep` parameter controls  which duplicate values are removed.
        The value 'first' keeps the first occurrence for each
        set of duplicated entries. The default value of keep is 'first'.

        >>> idx.drop_duplicates(keep='first')
        Index(['lama', 'cow', 'beetle', 'hippo'], dtype='object')

        The value 'last' keeps the last occurrence for each set of duplicated
        entries.

        >>> idx.drop_duplicates(keep='last')
        Index(['cow', 'beetle', 'lama', 'hippo'], dtype='object')

        The value ``False`` discards all sets of duplicated entries.

        >>> idx.drop_duplicates(keep=False)
        Index(['cow', 'beetle', 'hippo'], dtype='object')
        rc)r[rtr��drop_duplicates)r�rdr�s  �r�r�zIndex.drop_duplicates�s,���\�>�>��:�:�<���w�&�D�&�1�1r�c��|jr$tjt|�t��S|j|��S)a
        Indicate duplicate index values.

        Duplicated values are indicated as ``True`` values in the resulting
        array. Either all duplicates, all except the first, or all except the
        last occurrence of duplicates can be indicated.

        Parameters
        ----------
        keep : {'first', 'last', False}, default 'first'
            The value or values in a set of duplicates to mark as missing.

            - 'first' : Mark duplicates as ``True`` except for the first
              occurrence.
            - 'last' : Mark duplicates as ``True`` except for the last
              occurrence.
            - ``False`` : Mark all duplicates as ``True``.

        Returns
        -------
        np.ndarray[bool]

        See Also
        --------
        Series.duplicated : Equivalent method on pandas.Series.
        DataFrame.duplicated : Equivalent method on pandas.DataFrame.
        Index.drop_duplicates : Remove duplicate values from Index.

        Examples
        --------
        By default, for each set of duplicated values, the first occurrence is
        set to False and all others to True:

        >>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama'])
        >>> idx.duplicated()
        array([False, False,  True, False,  True])

        which is equivalent to

        >>> idx.duplicated(keep='first')
        array([False, False,  True, False,  True])

        By using 'last', the last occurrence of each set of duplicated values
        is set on False and all others on True:

        >>> idx.duplicated(keep='last')
        array([ True, False,  True, False, False])

        By setting keep on ``False``, all duplicates are True:

        >>> idx.duplicated(keep=False)
        array([ True, False,  True, False,  True])
        rrc)r[r�zerosr,r��_duplicated)r�rds  r�r�zIndex.duplicated2s5��l�>�>��8�8�C��I�T�2�2����T��*�*r�c��||zSr�r�rxs  r��__iadd__zIndex.__iadd__ps���e�|�r�c�F�tdt|�j�d���)NzThe truth value of a zC is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().)r.rIr�r�s r��__nonzero__zIndex.__nonzero__ts-���#�D��J�$7�$7�#8�9C�
C�
�	
r�c�\�t||�}|j|ur|j|�S|S)z�
        If the result of a set operation will be self,
        return self, unless the name changes, in which
        case make a shallow copy of self.
        )r�r�rV)r�r�r�s   r��_get_reconciled_name_objectz!Index._get_reconciled_name_object�s0��"�$��.���9�9�D� ��;�;�t�$�$��r�c�*�|dvrtd|�d���y)N)NFTzBThe 'sort' keyword only takes the values of None, True, or False; z was passed.�r.)r�r�s  r��_validate_sort_keywordzIndex._validate_sort_keyword�s.���*�*��)�)-��l�<��
�+r�c���t|t�rNt|t�r>|j�2|j�&|jd�}|jd�}||fS||fS)z>
        With mismatched timezones, cast both to UTC.
        �UTC)rr^�tz�
tz_convert)r�r��setopr��rights     r��_dti_setop_align_tzszIndex._dti_setop_align_tzs�sb��
�t�-�.��5�"2�3����#����$��?�?�5�)�D��$�$�U�+�E���;���U�{�r�c��|j|�|j|�|j|�\}}|j|jk7r�t	|t
�r-t
t|��st|�dkDrtd��|j|d�\}}|j|�}|j|d��}|j|d��}|j||��St|�r|j|�r'|j|�}|dur|j!�S|St|�s'|j|�}|dur|j!�S|S|j#||��}|j%||�S)a�
        Form the union of two Index objects.

        If the Index objects are incompatible, both Index objects will be
        cast to dtype('object') first.

        Parameters
        ----------
        other : Index or array-like
        sort : bool or None, default None
            Whether to sort the resulting Index.

            * None : Sort the result, except when

              1. `self` and `other` are equal.
              2. `self` or `other` has length 0.
              3. Some values in `self` or `other` cannot be compared.
                 A RuntimeWarning is issued in this case.

            * False : do not sort the result.
            * True : Sort the result (which may raise TypeError).

        Returns
        -------
        Index

        Examples
        --------
        Union matching dtypes

        >>> idx1 = pd.Index([1, 2, 3, 4])
        >>> idx2 = pd.Index([3, 4, 5, 6])
        >>> idx1.union(idx2)
        Index([1, 2, 3, 4, 5, 6], dtype='int64')

        Union mismatched dtypes

        >>> idx1 = pd.Index(['a', 'b', 'c', 'd'])
        >>> idx2 = pd.Index([1, 2, 3, 4])
        >>> idx1.union(idx2)
        Index(['a', 'b', 'c', 'd', 1, 2, 3, 4], dtype='object')

        MultiIndex case

        >>> idx1 = pd.MultiIndex.from_arrays(
        ...     [[1, 1, 2, 2], ["Red", "Blue", "Red", "Blue"]]
        ... )
        >>> idx1
        MultiIndex([(1,  'Red'),
            (1, 'Blue'),
            (2,  'Red'),
            (2, 'Blue')],
           )
        >>> idx2 = pd.MultiIndex.from_arrays(
        ...     [[3, 3, 2, 2], ["Red", "Green", "Red", "Green"]]
        ... )
        >>> idx2
        MultiIndex([(3,   'Red'),
            (3, 'Green'),
            (2,   'Red'),
            (2, 'Green')],
           )
        >>> idx1.union(idx2)
        MultiIndex([(1,  'Blue'),
            (1,   'Red'),
            (2,  'Blue'),
            (2, 'Green'),
            (2,   'Red'),
            (3, 'Green'),
            (3,   'Red')],
           )
        >>> idx1.union(idx2, sort=False)
        MultiIndex([(1,   'Red'),
            (1,  'Blue'),
            (2,   'Red'),
            (2,  'Blue'),
            (3,   'Red'),
            (3, 'Green'),
            (2, 'Green')],
           )
        rzjCan only union MultiIndex with MultiIndex or Index of tuples, try mi.to_flat_index().union(other) instead.�unionFr�r�T)r��_assert_can_do_setop�_convert_can_do_setopr�rr`rM�_unpack_nested_dtyper,r@r��_find_common_type_compatrr��equalsr�ri�_union�_wrap_setop_result)r�r�r��result_namer�r�r�r9s        r�r�zIndex.union�sq��f	
�#�#�D�)��!�!�%�(�!�7�7��>���{��:�:����$��4��/�'�(<�U�(C�D���J��N�)�C����3�3�E�7�C�K�D�%��1�1�%�8�E��;�;�u�5�;�1�D��L�L��U�L�3�E��:�:�e�$�:�/�/��U��t�{�{�5�1��5�5�e�<�F��t�|��)�)�+�+��M��T���6�6�t�<�F��t�|��)�)�+�+��M����U���.���&�&�u�f�5�5r�c���|j}|j}|dvr]|jrQ|jrE|jr|js-|jr!|jr	|j	|�dS|js"tj||�}t!||�S|j"r(|j%|�}	|	dk(j'�d}
n'tj(|j+|�d�}
|j,r!|j/|j1|
��}n/t3|
�dkDr|j1|
�}t5||f�}n|}|jr|jst!||�}|S#t
tf$r^t|�}t|�}|j|D�cgc]	}||vs�|��ncc}wc}�tj|t��cYSwxYw)aC
        Specific union logic should go here. In subclasses, union behavior
        should be overwritten here rather than in `self.union`.

        Parameters
        ----------
        other : Index or array-like
        sort : False or None, default False
            Whether to sort the resulting index.

            * True : sort the result
            * False : do not sort the result.
            * None : sort the result, except when `self` and `other` are equal
              or when the values cannot be compared.

        Returns
        -------
        Index
        �NTrrr�r=)rr�r��_can_use_libjoinr�r�rr(�set�extendrr-r�r[r�union_with_duplicates�_maybe_try_sort�_index_as_unique�get_indexer�nonzero�unique1d�get_indexer_non_uniquerRr�r�r,rT)
r�r�r��lvals�rvals�
value_list�	value_setr��result_dups�indexer�missingr9�
other_diffs
             r�r�zIndex._union 
s���(�����
�
��
�L� ��,�,��-�-��(�(�U�-A�-A��%�%��&�&�


:��*�*�5�1�!�4�4�����5�5�d�E�B�K�"�;��5�5�� � ��&�&�u�-�G��"�}�-�-�/��2�G��n�n�T�%@�%@��%G��%J�K�G��>�>��[�[����G�!4�5�F��7�|�a��"�Z�Z��0�
�&��z�':�;�����+�+�5�3P�3P�$�V�T�2�F��
��S�4�5�
:�!�%�[�
� ��J�	��!�!�e�"J�e��q�	�7I�1�e��"J�K��x�x�
�&�9�9�
:�s$�&F�4G2�9	G
�G
�(G2�1G2c��t||�}t|t�r"|j|k7r|j	|�}|S|j||��}|S�NrQ)r�rr�r�rVrq)r�r�r9r�s    r�r�zIndex._wrap_setop_resulto
sU��!�$��.���f�e�$��{�{�d�"����t�,���
��'�'��T�'�:�F��
r�c�~�|j|�|j|�|j|�\}}|j|jk7r|j	|d�\}}|j|�rS|js |j�j|�}n|j|�}|dur|j�}|St|�dk(st|�dk(r�|js|jr|ddj|�S|j|�}|j|k(r6t|�dk(r|ddj|�S|ddj|�Stg||��S|j|�s1t!|t"�r|ddj|�Stg|��S|j|jk7rJ|j|�}|j%|d��}|j%|d��}|j'||�	�S|j)||�	�}|j+||�S)
a 
        Form the intersection of two Index objects.

        This returns a new Index with elements common to the index and `other`.

        Parameters
        ----------
        other : Index or array-like
        sort : True, False or None, default False
            Whether to sort the resulting index.

            * None : sort the result, except when `self` and `other` are equal
              or when the values cannot be compared.
            * False : do not sort the result.
            * True : Sort the result (which may raise TypeError).

        Returns
        -------
        Index

        Examples
        --------
        >>> idx1 = pd.Index([1, 2, 3, 4])
        >>> idx2 = pd.Index([3, 4, 5, 6])
        >>> idx1.intersection(idx2)
        Index([3, 4], dtype='int64')
        �intersectionTrN)r�r�rQFrr�)r�r�r�r�r�r�r[r�r�rir,rRrVr�r��_should_comparerr`rr��
_intersection�_wrap_intersection_result)r�r�r�r�r9r��thiss       r�r�zIndex.intersectiony
s	��>	
�#�#�D�)��!�!�%�(�!�7�7��>���{��:�:����$��3�3�E�>�J�K�D�%��;�;�u���>�>�����B�B�5�I���9�9�%�@���t�|��+�+�-���M��t�9��>�S��Z�1�_��~�~�����B�Q�x���{�3�3��1�1�%�8�E��z�z�U�"��t�9��>����8�?�?�;�7�7� ��!�9�+�+�K�8�8���5�{�;�;��%�%�e�,��$�
�.��B�Q�x���{�3�3���+�.�.�
�Z�Z�5�;�;�
&��1�1�%�8�E��;�;�u�5�;�1�D��L�L��U�L�3�E��$�$�U��$�6�6��#�#�E��#�5���-�-�e�V�<�<r�c��|jr�|jr�|jr�|jrw	|j|�\}}}t|j�r tj|�}t|�S|j|�}|j�}t|�S|j||��}t||�}|S#t$rY�,wxYw)zL
        intersection specialized to the case with matching dtypes.
        r�)
r�r�r�rLr�rr�r�r�ryr��_intersection_via_get_indexerr�)	r�r�r��res_indexerr��_�resr9r�s	         r�r�zIndex._intersection�
s���

�(�(��-�-��%�%��&�&�
;�*.�*=�*=�e�*D�'��W�a�$�D�J�J�/� �.�.��5�C�6�c�:�:�"�Y�Y�w�/�F� �0�0�2�C�5�c�:�:��7�7��D�7�I�
�$�Z��6�
����!�
��
�s�C	�		C�Cc�&�|j||�Sr��r��r�r�r9s   r�r�zIndex._wrap_intersection_result�
����&�&�u�f�5�5r�c�d�|j�}|j�}|j|�}|dk7}|j|j�d�}|durt	j
|�}t
|t�r|j|�}|S|j|�j}|S)z�
        Find the intersection of two Indexes using get_indexer.

        Returns
        -------
        np.ndarray or ExtensionArray or MultiIndex
            The returned array will be unique.
        r�rF)	r��get_indexer_forr�r�rr�rr`r)	r�r�r��left_unique�right_uniquer�r|�takerr9s	         r�rz#Index._intersection_via_get_indexer�
s����k�k�m���|�|�~���-�-�l�;���"�}�����T�\�\�^�A�.�/���5�=��G�G�E�N�E��k�=�1� �%�%�e�,�F��
�!�%�%�e�,�4�4�F��
r�c��|j|�|j|�|j|�\}}|j|�r|ddj	|�St|�dk(r5|j
�j	|�}|dur|j�S|S|j|�s5|j
�j	|�}|dur|j�S|S|j||��}|j||�S)a�
        Return a new Index with elements of index not in `other`.

        This is the set difference of two Index objects.

        Parameters
        ----------
        other : Index or array-like
        sort : bool or None, default None
            Whether to sort the resulting index. By default, the
            values are attempted to be sorted, but any TypeError from
            incomparable elements is caught by pandas.

            * None : Attempt to sort the result, but catch any TypeErrors
              from comparing incomparable elements.
            * False : Do not sort the result.
            * True : Sort the result (which may raise TypeError).

        Returns
        -------
        Index

        Examples
        --------
        >>> idx1 = pd.Index([2, 1, 3, 4])
        >>> idx2 = pd.Index([3, 4, 5, 6])
        >>> idx1.difference(idx2)
        Index([1, 2], dtype='int64')
        >>> idx1.difference(idx2, sort=False)
        Index([2, 1], dtype='int64')
        NrTr�)r�r�r�r�rVr,r�rir��_difference�_wrap_difference_result)r�r�r�r�r9s     r��
differencezIndex.differences���B	
�#�#�D�)��!�!�%�(�!�7�7��>���{��;�;�u�����8�?�?�;�/�/��u�:��?��[�[�]�)�)�+�6�F��t�|��)�)�+�+��M��#�#�E�*��[�[�]�)�)�+�6�F��t�|��)�)�+�+��M��!�!�%�d�!�3���+�+�E�6�:�:r�c��|}t|t�r(|jr|jr|j�}|j	�}||j|�dk(}|jr|n|j	�}t||�}|S�Nr�)rr\r�r�r�r	r[r�)r�r�r�r��the_diffs     r�rzIndex._differencePss�����d�/�0�T�\�\�e�m�m��;�;�=�D��������-�-�d�3�r�9�:��#�~�~�8�8�?�?�3D��"�8�T�2���r�c�&�|j||�Sr�rrs   r�rzIndex._wrap_difference_result[rr�c��|j|�|j|�|j|�\}}|�|}|j|jk7r|j	|d�\}}|j|�s"|j
||��j|�S|j|jk7rY|j|�}|j|d��}|j|d��}|j||��j|�S|j�}|j�}|j|�}|j|dk7j�d�}	tj tj"|j$�|	d��}
|j|
�}|dk(j�d}|j|�}
|j'|
�}t)||�}|j*st-|||j�	�St/d
|�}t1|�dk(r|j3�j5|�S|j5|�S)a�
        Compute the symmetric difference of two Index objects.

        Parameters
        ----------
        other : Index or array-like
        result_name : str
        sort : bool or None, default None
            Whether to sort the resulting index. By default, the
            values are attempted to be sorted, but any TypeError from
            incomparable elements is caught by pandas.

            * None : Attempt to sort the result, but catch any TypeErrors
              from comparing incomparable elements.
            * False : Do not sort the result.
            * True : Sort the result (which may raise TypeError).

        Returns
        -------
        Index

        Notes
        -----
        ``symmetric_difference`` contains elements that appear in either
        ``idx1`` or ``idx2`` but not both. Equivalent to the Index created by
        ``idx1.difference(idx2) | idx2.difference(idx1)`` with duplicates
        dropped.

        Examples
        --------
        >>> idx1 = pd.Index([1, 2, 3, 4])
        >>> idx2 = pd.Index([2, 3, 4, 5])
        >>> idx1.symmetric_difference(idx2)
        Index([1, 5], dtype='int64')
        �symmetric_differencer�Frr�rT)�
assume_unique�r�r�r�)r�r�r�r�r�r�r�rVr�rrr�r	r�r�r�	setdiff1drh�sizer�r�rRr�r
r,�remove_unused_levelsrJ)r�r�r�r��result_name_updater�r��thatr��common_indexer�left_indexer�	left_diff�
right_indexer�
right_diffr�r9s                r�rzIndex.symmetric_difference_s��H	
�#�#�D�)��!�!�%�(�$(�$>�$>�u�$E�!��!���,�K��:�:����$��3�3�E�;Q�R�K�D�%��#�#�E�*��:�:�e�$�:�/�6�6�{�C�C�
�Z�Z�5�;�;�
&��1�1�%�8�E��;�;�u�5�;�1�D��<�<��E�<�2�D��,�,�T��,�=�D�D�[�Q�Q��{�{�}��������&�&�u�-��!���w�"�}�&=�&=�&?��&B�C���|�|��I�I�d�i�i� �.��
���I�I�l�+�	�!�B��/�/�1�!�4�
��Z�Z�
�.�
��%�%�j�1�
� ��T�2���~�~���k��9I�9I�J�J��\�9�5�I��6�{�a�� �5�5�7�A�A�+�N�N��#�#�K�0�0r�c�0�t|�std��y)Nz!Input must be Index or array-likeT)rKr�rxs  r�r�zIndex._assert_can_do_setop�s���E�"��?�@�@�r�c��t|t�s't||j��}|j}||fSt||�}||fSr�)rr�r�r�)r�r�r�s   r�r�zIndex._convert_can_do_setop�sK���%��'��%�d�i�i�0�E��)�)�K��k�!�!�-�T�5�9�K��k�!�!r�c�X�|j|�}	|jj|�S#t$rX}t	|t
�s,t	|tj�rtd�|D��rt|��t|�|�d}~wt$r|j|��wxYw)a
        Get integer location, slice or boolean mask for requested label.

        Parameters
        ----------
        key : label

        Returns
        -------
        int if unique index, slice if monotonic index, else mask

        Examples
        --------
        >>> unique_index = pd.Index(list('abc'))
        >>> unique_index.get_loc('b')
        1

        >>> monotonic_index = pd.Index(list('abbc'))
        >>> monotonic_index.get_loc('b')
        slice(1, 3, None)

        >>> non_monotonic_index = pd.Index(list('abcb'))
        >>> non_monotonic_index.get_loc('b')
        array([False,  True, False,  True])
        c3�<K�|]}t|t����y�wr�)r�slicer�s  r�rz Index.get_loc.<locals>.<genexpr>�s����A�j��
�1�e�,�j�r
N)�_maybe_cast_indexerr|�get_locr�rr'rr�r�r1r��_check_indexing_error)r��key�
casted_keyr;s    r�r)z
Index.get_loc�s���4�-�-�c�2�
�	��<�<�'�'�
�3�3���	)��*�e�,��:�s�|�|�4��A�j�A�A�'��,�,��3�-�S�(���	�
�&�&�s�+��	�s�.�	B)�AB
�
B)c��t|�}|}|j|�}|j|||�|jst	|j
��t
|�dk(r%tjgtj��S|j|�s%|j|�s|j||d��St|jt�r�|j|jk(sJ�|j j#|j$�}|j&rT|j&rHt)|�}|j+tj,�}|j)�}	|||<d||	|z<|St|jt�r�|j#|j.�}
t1j2|
|j$d��}|j4sL|j&r@|j&r4|j+tj,�}|j)�}	|||	<t7|�S|j9|�\}}||us||ur|j#||||��S|j|jk(r?|j;|�r.tj<t
|�tj��S|j|jk7r]|j|�sL|j?|�}
|jA|
d�	�}|jA|
d�	�}|jC||||��S|jC||||�S)
a(
        Compute indexer and mask for new index given the current index.

        The indexer should be then used as an input to ndarray.take to align the
        current data to the new index.

        Parameters
        ----------
        target : Index
        method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional
            * default: exact matches only.
            * pad / ffill: find the PREVIOUS index value if no exact match.
            * backfill / bfill: use NEXT index value if no exact match
            * nearest: use the NEAREST index value if no exact match. Tied
              distances are broken by preferring the larger index value.
        limit : int, optional
            Maximum number of consecutive labels in ``target`` to match for
            inexact matches.
        tolerance : optional
            Maximum distance between original and new labels for inexact
            matches. The values of the index at the matching locations must
            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.

            Tolerance may be a scalar value, which applies the same tolerance
            to all values, or list-like, which applies variable tolerance per
            element. List-like includes list, tuple, array, Series, and must be
            the same size as the index and its dtype must exactly match the
            index's type.

        Returns
        -------
        np.ndarray[np.intp]
            Integers from 0 to n - 1 indicating that the index at these
            positions matches the corresponding target values. Missing values
            in the target are marked by -1.

        Notes
        -----
        Returns -1 for unmatched values, for further explanation see the
        example below.

        Examples
        --------
        >>> index = pd.Index(['c', 'a', 'b'])
        >>> index.get_indexer(['a', 'b', 'x'])
        array([ 1,  2, -1])

        Notice that the return value is an array of locations in ``index``
        and ``x`` is marked by -1, as it is not in ``index``.
        rrT�r�r�r��r��r��limit�	toleranceFr)"r�_maybe_cast_listlike_indexer�_check_indexing_methodr�r1�_requires_unique_msgr,rr-�intpr��_should_partial_index�_get_indexer_non_comparablerr�rVr|r�r�r�rhr)ryr�r�take_ndrRrC�_maybe_downcast_for_indexingr�rhr�r�_get_indexer)r��targetr�r1r2�orig_targetr��target_nans�locr|�categories_indexer�pself�ptargetr�r�s               r�r�zIndex.get_indexer�s���t+�6�2�����2�2�6�:���#�#�F�E�9�=��$�$�#�D�$=�$=�>�>��v�;�!���8�8�B�b�g�g�.�.��#�#�F�+�D�4N�4N�v�4V��3�3�F�6�RV�3�W�W��d�j�j�"2�3��:�:����-�-�-��l�l�.�.�v�|�|�<�G��|�|����
#�;�/���l�l�2�6�6�*���{�{�}��'*���$�/1����|�+�,��N��f�l�l�$4�5�
"&�!1�!1�&�2C�2C�!D���m�m�$6����QS�T�G��N�N�t�|�|�����l�l�2�6�6�*���{�{�}�� #���
�&�w�/�/��:�:�6�B���w�����v� 5��$�$���e�y�%��
��:�:����%�$�+�+�f�*=��9�9�S��[����8�8��:�:����%�d�.H�.H��.P��1�1�&�9�E��;�;�u�5�;�1�D��]�]�5�u�]�5�F��$�$��v�U�i�%��
�� � ����	�B�Br�c��|�|j||�}|dvr|j||||�}t|�S|dk(r|j|||�}t|�S|jr*|jr|j}|j|�}n|j
�}|jj|�}t|�S)N��pad�backfill�nearest)	�_convert_tolerance�_get_fill_indexer�_get_nearest_indexerrRr|�_extract_level_codesr�r�rC)r�r<r�r1r2r��engine�
tgt_valuess        r�r;zIndex._get_indexerss���� ��/�/�	�6�B�I��(�(��,�,�V�V�U�I�N�G� #�7�+�+��y�
 ��/�/���y�I�G�#�7�+�+����D�N�N�����$�8�8���
�$�6�6�8�
��l�l�.�.�z�:�G�"�7�+�+r�c��t|jt�r6t|jt�ry|jj	|�Sy)z>
        Should we attempt partial-matching indexing?
        F)rr�rYr�r��r�r<s  r�r7zIndex._should_partial_index�s;��
�d�j�j�-�0��&�,�,�
�6���9�9�,�,�V�4�4�r�c�B�|dvrtd��|jr!|dk(rtd��|dvr
|�td��t|jt
tf�r&|�$td|�d	t|�j����|�|�td
��|�td��yy)zY
        Raise if we have a get_indexer `method` that is not supported or valid.
        )N�bfillrFrE�ffillrGzInvalid fill methodrGzJmethod='nearest' not implemented yet for MultiIndex; see GitHub issue 9365rDNz,tolerance not implemented yet for MultiIndexzmethod z not yet implemented for zJtolerance argument only valid if doing pad, backfill or nearest reindexingzFlimit argument only valid if doing pad, backfill or nearest reindexing)	r.rRr@rr�rYrVrIr�)r�r�r1r2s    r�r4zIndex._check_indexing_method�s����O�O��2�3�3��>�>���"�)�<����,�,��(�-�F����d�j�j�=�2B�"C�D��!�)��f�X�%>�t�D�z�?R�?R�>S�T����>��$� �5���� � �5���!�
r�c
��tj|�}|j|jk7r|jdkDrtd��t	|�r�tj
|jtj�sx|jdkDr/tdt|�j�d|j�d���tdt|�j�d|j�dt|�����|S)Nr=z5list-like tolerance size must match target index sizerztolerance argument for z with dtype z1 must contain numeric elements if it is list typez$ must be numeric if it is a scalar: )rr&rr.rL�
issubdtyper��numberr>rIr��repr)r�r2r<s   r�rHzIndex._convert_tolerance�s����J�J�y�)�	��;�;�)�.�.�(�Y�^�^�a�-?��T�U�U�
�d�
#�B�M�M�)�/�/�2�9�9�,U��~�~��!� �-�d�4�j�.A�.A�-B�,��z�z�l�"S�U���
�)�$�t�*�*=�*=�)>�l�4�:�:�,�W6�6:�9�o�5F�H��
��r�c���|jr�|js|jstd��|j	|�j
j}t|dt|��}t|t|�d�}|j||||�S|jr�|jr�|j�}|j�}	t|tj�rt|	tj�st�|dk(rtj |	||��}
n,tj"|	||��}
n|j%|||�}
|�t|�r|j'||
|�}
|
S)N�0index must be monotonic increasing or decreasingrE�r1)rRr�r�r.r�r|rNr�r,rIr�rrrr@�libalgosrErF�_get_fill_indexer_searchsorted�_filter_indexer_tolerance)r�r<r�r1r2�encoded�self_encoded�target_encodedr��
own_valuesr�s           r�rIzIndex._get_fill_indexer�sF���>�>��0�0�D�4P�4P� �!S�T�T��k�k�&�)�1�1�8�8�G� ���3�t�9�!5�6�L�"�7�3�t�9�;�#7�8�N��1�1����y��
��'�'�F�,J�,J�"�5�5�7�M��0�0�2�J��m�R�Z�Z�8�
��B�J�J�A�*�)����"�,�,�z�=��N��#�+�+�J�
�U�S���9�9�&�&�%�P�G�� �S��Y��4�4�V�W�i�P�G��r�c���|�tdt|��d���|dk(rdnd}|j|�}|dk(}|j|||�||<|dk(r||xxdzcc<|Sd||t	|�k(<|S)z�
        Fallback pad/backfill get_indexer that works for monotonic decreasing
        indexes and non-monotonic targets.
        zlimit argument for z; method only well-defined if index and target are monotonicrEr�r�r�r=)r.rVr��_searchsorted_monotonicr,)r�r<r�r1�sider��nonexacts       r�r[z$Index._get_fill_indexer_searchsorted�s������%�d�6�l�^�44�4��
�
4:�U�?�����"�"�6�*���b�=�� �8�8���9I�4�P�����6�>�

�H���"����-/�G�G�s�4�y�(�)��r�c��t|�s|j|d�S|j|d|��}|j|d|��}|j||�}|j||�}|jrt
jnt
j}tj|||�|dk(z||�}	|�|j||	|�}	|	S)z�
        Get the indexer for the nearest index labels; requires an index with
        values that can be subtracted from each other (e.g., not strings or
        tuples).
        rErYrFr�)r,rIr��_difference_compatr��operator�lt�ler�wherer\)
r�r<r1r2rr!�left_distances�right_distances�opr�s
          r�rJzIndex._get_nearest_indexers����4�y��)�)�&�%�8�8��'�'���U�'�C���(�(���5�(�I�
��0�0���F���1�1�&�-�H�� �8�8�X�[�[�h�k�k���(�(�
�~��/���"�
$���
��� ��4�4�V�W�i�P�G��r�c�Z�|j||�}tj||k|d�Sr)rfrrj)r�r<r�r2�distances     r�r\zIndex._filter_indexer_tolerance?s.���*�*�6�7�;���x�x��I�-�w��;�;r�c�*�t|jt�rStd|j�j
}td|j�j
}|||z
}t|�S|j||jz
}t|�S)Nr�)rr�rZr
r�r�r�abs)r�r<r�r`r��diffs      r�rfzIndex._difference_compatJs|���d�j�j�+�.��m�T�Z�Z�8�A�A�J� �����=�F�F�M��g�&��6�D��4�y���<�<��(�6�>�>�9�D��4�y�r�c��|jd|jd�|jd|jd�|jd|jd�y)zz
        For positional indexing, a slice must have either int or None
        for each of start, stop, and step.
        �
positional�ilocN)�_validate_indexerr�stop�step�r�r+s  r��_validate_positional_slicez Index._validate_positional_slice_sF��	
���|�S�Y�Y��?����|�S�X�X�v�>����|�S�X�X�v�>r�c�@�|j|j|j}}}t|�}t	j
|jd�rH|dk(r0|r.||k(s)|dk7r$tjdtt���|j|||�S|dk(ru|r|S|jjdvrY|jd|jd�|jd|jd�|jd|jd�|S|xr|j}|r)	|�|j|�|�|j|�d}t#j$|�r|}|S|r|d	k(rt'd
��|}|S|j|||�}|S#t $rY�OwxYw)a(
        Convert a slice indexer.

        By definition, these are labels unless 'iloc' is passed in.
        Floats are not allowed as the start, step, or stop of the slice.

        Parameters
        ----------
        key : label of the slice bound
        kind : {'loc', 'getitem'}
        �f�getitemrz�The behavior of obj[i:j] with a float-dtype index is deprecated. In a future version, this will be treated as positional instead of label-based. For label-based slicing, use obj.loc[i:j] insteadr�iur'Fr?zjSlicing a positional slice with .loc is not allowed, Use .loc with labels or .iloc with positions instead.)rrwrxr}r�is_np_dtyper�r3r4r5r6�
slice_indexerr rv�_should_fallback_to_positionalr)r�r!�
is_null_slicer�)	r�r+r rrwrx�is_index_slice�
is_positionalr�s	         r��_convert_slice_indexerzIndex._convert_slice_indexeris��� �I�I�s�x�x����T�t��3�3�7���?�?�4�:�:�s�+��y� �^�E�T�M�d�VW�i�
�
�
�/�"�/�1���%�%�e�T�4�8�8��9����
������D�(��&�&�w��	�	�9�E��&�&�w����)�D��&�&�w����)�D��
�'�N�4�+N�+N�
��
��$��L�L��'��#��L�L��&� %�
����S�!��G�����u�}��L����G����(�(���d�;�G����#�
��
�s�%(F�	F�Fc
��d|�dt|�j�d|�dt|�j��}|tjurt	|�|�t	|��)z;
        Raise consistent invalid indexer message.
        z
cannot do z
 indexing on z with these indexers [z
] of type )rIr�rrr�)r��formr+�reraiser]s     r��_raise_invalid_indexerzIndex._raise_invalid_indexer�sf�����m�D��J�,?�,?�+@�A���Z��S�	�(:�(:�';�
=�	��#�.�.�(��C�.�g�-���n�r�c�J�|jst|�rtd��yy)z�
        Check if we are allowing reindexing with this particular indexer.

        Parameters
        ----------
        indexer : an integer ndarray

        Raises
        ------
        ValueError if its a duplicate axis
        �/cannot reindex on an axis with duplicate labelsN)r�r,r.)r�r�s  r��_validate_can_reindexzIndex._validate_can_reindex�s'���$�$��W���N�O�O�*6�$r�c��t|d�}t|�}t|t�s4t	|�dk(r&|�|j
r|j|}n|}|dd}nt|�}|�Rt|t�st|t�r2|�td��|j||d|j
��\}}}	nx|j|�rd}nd|jr|j||||��}nB|j
rtd��|jstd	��|j!|�\}}	|j#|||�}||fS)
a�
        Create index with target's values.

        Parameters
        ----------
        target : an iterable
        method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional
            * default: exact matches only.
            * pad / ffill: find the PREVIOUS index value if no exact match.
            * backfill / bfill: use NEXT index value if no exact match
            * nearest: use the NEAREST index value if no exact match. Tied
              distances are broken by preferring the larger index value.
        level : int, optional
            Level of multiindex.
        limit : int, optional
            Maximum number of consecutive labels in ``target`` to match for
            inexact matches.
        tolerance : int or float, optional
            Maximum distance between original and new labels for inexact
            matches. The values of the index at the matching locations must
            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.

            Tolerance may be a scalar value, which applies the same tolerance
            to all values, or list-like, which applies variable tolerance per
            element. List-like includes list, tuple, array, Series, and must be
            the same size as the index and its dtype must exactly match the
            index's type.

        Returns
        -------
        new_index : pd.Index
            Resulting index.
        indexer : np.ndarray[np.intp] or None
            Indices of output values in original index.

        Raises
        ------
        TypeError
            If ``method`` passed along with ``level``.
        ValueError
            If non-unique multi-index
        ValueError
            If non-unique index and ``method`` or ``limit`` passed.

        See Also
        --------
        Series.reindex : Conform Series to new index with optional filling logic.
        DataFrame.reindex : Conform DataFrame to new index with optional filling logic.

        Examples
        --------
        >>> idx = pd.Index(['car', 'bike', 'train', 'tractor'])
        >>> idx
        Index(['car', 'bike', 'train', 'tractor'], dtype='object')
        >>> idx.reindex(['car', 'bike'])
        (Index(['car', 'bike'], dtype='object'), array([0, 1]))
        r�rNz)Fill method not supported if level passedr�)r��
keep_orderr0z'cannot handle a non-unique multi-index!r�)r%�ensure_has_lenrr�r,rRrw�ensure_indexr`r��_join_levelr�r�r�r.r[r��_wrap_reindex_result)
r�r<r�r�r1r2�preserve_namesrRr�rs
          r��reindexz
Index.reindex�sV��F%�V�V�4�4�� ��'���&�%�(�S��[�A�-=�� �T�^�^��k�k�%�(������!�W�F�!�&�)�F����t�]�+�z�&�-�/P��!�� K�L�L�"&�!1�!1���7�4�>�>�7I�"2�"��F�G�Q�
�{�{�6�"����(�(�"�.�.��v�U�i�/��G��^�^�$�%N�O�O����$�%V�W�W�!%�!<�!<�V�!D�J�G�Q��*�*�6�7�N�K���w��r�c�*�|j||�}|Sr�)�_maybe_preserve_names)r�r<r�r�s    r�r�zIndex._wrap_reindex_resultTs���+�+�F�N�C���
r�c��|rK|jdk(r<|j|jk7r#|jd��}|j|_|S)Nr=Fr�)rkr�r)r�r<r�s   r�r�zIndex._maybe_preserve_namesXs?���f�n�n��1�f�k�k�T�Y�Y�6N��[�[�e�[�,�F��)�)�F�K��
r�c��t|�}t|�dk(r+|ddtjgtj��dfS|j|�\}}|dk7}|j
||�}d}t|��r}tjt|�tj��}t|�}|j
|�}||}	|j
||�j}
||}tjt|�ft��}|
||<|||	<t|�s&tjdtj��}n�|jrUtjt|�tj��}tjt|
��||<d||	<nId||<tjt|j
|��tj��}d||<t|t�st||j ��}n&t#|�j%||j&��}|||fS)a�
        Create a new index with target's values (move/add/delete values as
        necessary) use with non-unique Index and a possibly non-unique target.

        Parameters
        ----------
        target : an iterable

        Returns
        -------
        new_index : pd.Index
            Resulting index.
        indexer : np.ndarray[np.intp]
            Indices of output values in original index.
        new_indexer : np.ndarray[np.intp] or None

        rNrr�rQr)r�r,rr-r6r�r�rhrCrNr�r�r[rr`r�r�rIr+r)
r�r<r�r��check�
new_labels�new_indexerr��missing_labels�missing_indexer�
cur_labels�cur_indexerr�s
             r��_reindex_non_uniquezIndex._reindex_non_unique^s���*�f�%���v�;�!�����8�R�X�X�b����8�$�>�>��6�6�v�>�����2�
��)-���7�5�>�)B�
����w�<��Y�Y�s�7�|�2�7�7�;�F�)�'�2�G�#�[�[��1�N�$�e�V�n�O����7�5�>�2�9�9�J� ��-�K����3�w�<�/��@�J�&0�J�{�#�*8�J��'��t�9� �i�i�����9���!�!� �i�i��G��B�G�G�D��+-�9�9�S��_�+E��K�(�/1��O�,�#%�����!�i�i��D�I�I�g�,>�(?�r�w�w�O��&(��U�F�#��$�
�.��j�t�y�y�9�I��T�
�.�.�z����.�L�I��'�;�.�.r�r�c��yr�r��r�r�r�r�r�r�s      r�r�z
Index.join����	r�r�c��yr�r�r�s      r�r�z
Index.join�r�r�c��yr�r�r�s      r�r�z
Index.join�r�r�r�c���t|�}|xs|dk(}t|t�r8t|t�r(|jdu|jduzrt	d��|j
s>|j
s2|j
|�\}}||us||ur|j|||d|��S|�E|j
s|j
r-|j|jk(rn|j||��S|�,|j
s|j
r|j|||��St|�dk(st|�dk(r	|j|||�S|j|jk7rK|j|�}|j|d�	�}	|j|d�	�}|	j||d�
�St|t �rot|t �r_|j"sS|j$j'|j$�s.t)|j*j-|j$��}t/|�|j0rP|j0rD|j2r8|j2r,|j4s|j4r	|j7||��S|j4r|j4s|j9|||��S|j;|||�S#t$rY���wxYw#t$rY�.wxYw)a
        Compute join_index and indexers to conform data structures to the new index.

        Parameters
        ----------
        other : Index
        how : {'left', 'right', 'inner', 'outer'}
        level : int or level name, default None
        return_indexers : bool, default False
        sort : bool, default False
            Sort the join keys lexicographically in the result Index. If False,
            the order of the join keys depends on the join type (how keyword).

        Returns
        -------
        join_index, (left_indexer, right_indexer)

        Examples
        --------
        >>> idx1 = pd.Index([1, 2, 3])
        >>> idx2 = pd.Index([4, 5, 6])
        >>> idx1.join(idx2, how='outer')
        Index([1, 2, 3, 4, 5, 6], dtype='int64')
        �outerNz0Cannot join tz-naive with tz-aware DatetimeIndexTr��r�rFr�r�r��r�r�)r�rr^r�r�rRr:r�r�_join_multir�r,�_join_emptyr�r�rr\�orderedr�r�r�r�reorder_categories�_validate_join_methodr�r�r[�_join_monotonic�_join_non_unique�_join_via_get_indexer)
r�r�r�r�r�r�rA�potherr�r�s
          r�r�z
Index.join�s���F�U�#���%�s�g�~���d�,�-�*�U�DT�2U����4��E�H�H��$4�5�� R�S�S��~�~�e�o�o� �=�=�e�D�M�E�6��D� �F�%�$7��z�z���5�$�T�"����=�d�n�n�����z�z�U�[�[�(���'�'��3�'�7�7���$�.�.�E�O�O��#�#�E�5�c�#�:�:��t�9��>�S��Z�1�_�
��'�'��s�D�9�9�
�:�:����$��1�1�%�8�E��;�;�u�5�;�1�D��L�L��U�L�3�E��9�9�U��T�9�B�B��t�0�1��5�"5�6��L�L��O�O�*�*�5�+;�+;�<��%�-�-�:�:�4�?�?�K�L�E��c�"�
�(�(��-�-��%�%��&�&����5�?�?�
��+�+�E�s�+�;�;����u����(�(��C�d�(�C�C��)�)�%��d�;�;��G�
��
��:�
��
�s$�9K�K%�	K"�!K"�%	K1�0K1c�J�t|�dk(st|�dk(sJ�t|�t|�r;ttddd�j	||��}|j|||�\}}}n�|dvru|r.|js"|j�}|j|�}nd}|j�}tjtjd�t|��}n7|j�}tjgtj��}d}|||fS)Nrr�r��r�r�)r�r�r�r)r,r�r
r(r�r�r��argsortr�rtr�broadcast_tor6r-)r�r�r�r�r�r�r�s       r�r�zIndex._join_empty5s����4�y�A�~��U��q��0�0��c�"�
�u�:��w��6� B� F� F�s�C� P�Q�C�%*�%6�%6�t�S�$�%G�"�J��d�
�%�
%��D�8�8��|�|�~��!�Y�Y�t�_�
���!�Z�Z�\�
��?�?�2�7�7�2�;��J��@�D�����J��8�8�B�b�g�g�.�D��D��4��%�%r�c��|dk(r|r|j�n|}nL|dk(r|r|j�n|}n2|dk(r|j||��}n|dk(r	|j||��}|urd}n|j|�}||urd}n|j|�}|||fS#t$r1|j|�}	t	||�}n#t$rYnwxYwY�nwxYw)Nr�r��innerr�r�)rir�r�r�r�r	)r�r�r�r�r��lindexer�rindexers       r�r�zIndex._join_via_get_indexerPs����&�=�/3��)�)�+��J�
�G�^�04��*�*�,�%�J�
�G�^��*�*�5�t�*�<�J�
�G�^�
�!�Z�Z��D�Z�9�
�����H��+�+�J�7�H�����H��,�,�Z�8�H��8�X�-�-���
�!�Z�Z��.�
��!0��T�!B�J�� �����	
�s6�B�C�7C�C�	C�
C�C�C�Cc��ddlm}ddlm}t	tj|j��}t	tj|j��}|j}|j}t|�}	t|�}
|	|
z}|std��t||�r�t||�r�t|	|z
|��}t|
|z
|��}
t||
z�s|}|j|j�}n"|j|�}|j|
�}|j!||d��\}}}||
z}|||||||�\}}}||||d�	�}|j#�}|d
k(r||z}n||
z}|j|�}|||fSt%t'|��}d}t||�r||}}d}dd
d�}|j)||�}|jj|�}|j+|||�
�}|r|d|d|dfS|S)Nrr)� restore_dropped_levels_multijoinz+cannot join with no overlapping index names)r+Tr�Frvr�r��r�r�r�rr=)r*r��pandas.core.reshape.merger�r(r!�not_nonerrr�r.rrqr,�reorder_levelsrtr�r�next�iterr�r�)r�r�r�r�r��self_names_list�other_names_list�self_names_order�other_names_order�
self_names�other_names�overlap�ldrop_names�rdrop_names�
self_jnlevels�other_jnlevels�join_idxr�r��
dropped_namesrwr�r�multi_join_idx�level_order�jl�
flip_order�flipr�r9s                              r�r�zIndex._join_multissE��8�N��s�|�|�T�Z�Z�8�9������e�k�k� :�;��*�0�0��,�2�2����)�
��*�+���{�*����J�K�K��d�J�'�J�u�j�,I� ��g�!5�;K�L�K� ��w�!6�<M�N�K��{�[�0�1� $�
�!&�!5�!5�d�j�j�!A�� $���{� ;�
�!&����!=��$1�#5�#5��C��$6�$� �H�d�D�(�+�5�M�
$D�������
$� �F�E�5�(��U�%�%��N�,�@�@�B�N��g�~�.��<��-��;��+�:�:�;�G�N�!�4��-�-�
�$�w�-�
 ���
��d�J�'���%�D��J�5;�W�+M�D��(�(�3��$�C����!�!�"�%���!�!�%��C�!�8����!�9�f�Q�i����2�2��
r�c�P�ddlm}|j|jk(sJ�||j|j||��\}}|dk(}|j	|�}|j	|�}	|j||	�}
t
|
t�r|dk(r|
j�}
|
||fS)Nr)�get_join_indexers_non_uniquer�r�r�)	r�r�r�rr�rxrr`r])r�r�r�r�r��left_idx�	right_idxr|r�r�r�s           r�r�zIndex._join_non_unique�s���	K��z�z�U�[�[�(�(�(�:��L�L�%�-�-�S�t�
���)��2�~���9�9�X�&���
�
�9�%���%�%�d�E�2�
��j�-�0�S�G�^�#�:�:�<�J��8�Y�.�.r�c�^�ddlm}dd�}t||�rt||�rtd��||}}t||�}	|	r||}}ddd�}
|
j	||�}t||�sJ�|j|�}|j|}|jstd��|j||d	�
�\}}
}|
�5|st|�dk(rd}|}�n�||jd|dz�}||}�n�t|
�}
tj|
t|��}|j|}||d
k7}|j|�}t!|j�}|||<t!|j�}|||<|rut#j$t|�t"j&��}t)t"j*|�}|d
k7}|j-�s�|D�cgc]}||��	}}||}n�|dk(rYt|�dk(rdn|j/�}d|z}t1j2||�\}}||dd}|D�cgc]}||��	}}na|d
k7}|j-�}|s|D�cgc]}||��	}}||d|dz�}|D�cgc]}||��	}}|s|j5�d|}||||j6d��}|�|j|j|�}n|j|}|	r||}}|�dn
t|�}|�dn
t|�}|||fScc}wcc}wcc}wcc}w)ai
        The join method *only* affects the level of the resulting
        MultiIndex. Otherwise it just exactly aligns the Index data to the
        labels of the level in the MultiIndex.

        If ```keep_order == True```, the order of the data indexed by the
        MultiIndex will not be changed; otherwise, it will tie out
        with `other`.
        rrc��|djdk(r%tjdtj��St	|�dk(rtt
|d��S|ddd|dddk7}|ddD]}||dd|ddk7z}�tjdg|dgf�j�d}t|d�}tj|t
|��S)aj
            Returns sorter for the inner most level while preserving the
            order of higher levels.

            Parameters
            ----------
            labels : list[np.ndarray]
                Each ndarray has signed integer dtype, not necessarily identical.

            Returns
            -------
            np.ndarray[np.intp]
            rrr=Nr�T)rrr�r6r,r�rC�hstackr�rAr�get_level_sorter)r��tic�lab�startss    r��_get_leaf_sorterz+Index._join_level.<locals>._get_leaf_sorter�s����a�y�~�~��"��x�x�����1�1��6�{�a��-�.A�&��)�.L�M�M���)�C�R�.�F�1�I�a�b�M�1�C��a��|���s�3�B�x�3�q�r�7�*�*��$��Y�Y����d�V�4�5�=�=�?��B�F��v�b�z�*�C��'�'��-@��-H�I�Ir�z9Join on level between two MultiIndex objects is ambiguousr�r�r�z8Index._join_level on non-unique index is not implementedTr�Nr=r�rFrv)r�zlist[np.ndarray]�return�npt.NDArray[np.intp])r*r�rr�r�rdrwr[r@r�r,r�rCr�get_reverse_indexerr�r(rrhr6r
rr)�maxrZ�groupsort_indexerr�r)r�r�r�r�r�r�r�r�r�r�r��	old_level�	new_level�left_lev_indexer�right_lev_indexerrr��rev_indexer�	old_codesr�
new_lev_codesr{rzr|r��max_new_lev�ngroups�counts�mask_allr!s                              r�r�zIndex._join_level�s���	9�	J�<�d�J�'�J�u�j�,I��W�X�X��E�e��#�D�*�5�5�
����%�D�5;�W�+M�D��(�(�3��$�C��$�
�+�+�+��&�&�u�-���K�K��&�	����%�J��
�:C����s�D�:H�:
�6�	�#�%6��#��S��Y�!�^�#��!�
�/��
�
�;�U�Q�Y�0G�H��!�,�/�
� 3�3C�D���1�1�2B�C�	�N�S�K��
�
�5�)�I��i�2�o�.�E�'�,�,�U�3�M��T�Z�Z�(�I�,�I�e���d�k�k�*�J� )�J�u���!�y�y��T��"�'�'�B��#�B�J�J��=��$��*���x�x�z�6?� @�i�s��T��i�I� @�#/��#5�L��A�:�'*�=�'9�Q�'>�!�M�DU�DU�DW�K��+�o�G�+3�+E�+E�%�w�,�(�L�&�
$0��q�	��#<�L�>G� H�i�s��\�!2�i�I� H�)�B�.�D�#�x�x�z�H�#�:C�$D�)�3�S��Y�)�	�$D�#3�I�k���	�4J�#K�L�>G� H�i�s��\�!2�i�I� H�$�'+�|�|�~�a�'8��'F��#�!���j�j�!&�	�J��(�-�2�2�:�3C�3C�E�3J�K�M�&�,�,�U�3�M��*7��-�L�!�(�D�.A�,�.O�	�"�)�D�/B�=�/Q�	��<��6�6��e!A��!I��%E��!Is�L�<L �&L%�L*c�X�|j|jk(sJ�|jr|jsJ�|j|�r|dk(r|n|}|ddfS|jr�|jr�|dk(r|}d}|j	|�}�n|dk(r|}|j	|�}d}n�|dk(r*|j|�\}}}|j
||||�}n�|dk(r�|j|�\}}}|j
||||�}n�|dk(r|j|�\}}}nP|dk(r|j|�\}}}n5|dk(r|j|�\}}}n|dk(r|j|�\}}}�J��J�|j
|||�}�dn
t|�}�dn
t|�}||fS)Nr�r�r�r�)
r�r�r�r[r�r��_wrap_joined_indexr�r�rC)r�r�r��	ret_indexr�r�r��
join_arrays        r�r�zIndex._join_monotonicws���
�{�{�d�j�j�(�(�(��$�$��)?�)?�?�?��;�;�u��"%����T�I��d�D�(�(�
�>�>�e�o�o��f�}�!�
����0�0��7�����"�
��1�1�$�7�������)-�)<�)<�U�)C�&�
�D�$�!�4�4�Z���d�S�
����)-�)<�)<�U�)C�&�
�D�$�!�4�4�Z���d�S�
��f�}�)-�);�);�E�)B�&�
�D�$����).�)<�)<�T�)B�&�
�D�$����)-�)<�)<�U�)C�&�
�D�$����)-�)<�)<�U�)C�&�
�D�$��#�#�#��#�#�#��0�0��U�D�$�O�J��|�t�)<�T�)B���|�t�)<�T�)B���4��%�%r�c���|j|jk(sJ�t|t�r�|j|jk(r|jnd}|dk(}|j	|�}td|j	|��}|j
||�j�}	|	j|�St||�}|jj|||j��S)Nr�r�r)r�rr`rr�r
rxr]rJr�rXrV)
r�r�r�r�r�r�r|r�r�r�s
          r�r�zIndex._wrap_joined_index�s����{�{�d�j�j�(�(�(��d�M�*�!%���u�{�{�!:�4�:�:��D��2�:�D��y�y���H���u�z�z�$�'7�8�E�!�)�)�$��6�M�M�O�J��'�'��-�-�%�d�E�2�D��$�$�0�0��d�$�*�*�0�U�Ur�c��t|�turWt|jtj�xs1t|j
ttf�xs|jdk(St|ttf�S)aG
        Whether we can use the fastpaths implemented in _libs.join.

        This is driven by whether (in monotonic increasing cases that are
        guaranteed not to have NAs) we can convert to a np.ndarray without
        making a copy. If we cannot, this negates the performance benefit
        of using libjoin.
        zstring[python])
rIr�rr�rrrorpr_r`r�s r�r�zIndex._can_use_libjoin�sl����:����4�:�:�r�x�x�0�2��d�l�l�-@�/�,R�S�2��:�:�!1�1�
��d�%5�}�$E�F�F�Fr�c��t�rI|j}t|tj�r!|j�}d|j_|S|jS)a�
        Return an array representing the data in the Index.

        .. warning::

           We recommend using :attr:`Index.array` or
           :meth:`Index.to_numpy`, depending on whether you need
           a reference to the underlying data or a NumPy array.

        Returns
        -------
        array: numpy.ndarray or ExtensionArray

        See Also
        --------
        Index.array : Reference to the underlying data.
        Index.to_numpy : A NumPy array representing the underlying data.

        Examples
        --------
        For :class:`pandas.Index`:

        >>> idx = pd.Index([1, 2, 3])
        >>> idx
        Index([1, 2, 3], dtype='int64')
        >>> idx.values
        array([1, 2, 3])

        For :class:`pandas.IntervalIndex`:

        >>> idx = pd.interval_range(start=0, end=5)
        >>> idx.values
        <IntervalArray>
        [(0, 1], (1, 2], (2, 3], (3, 4], (4, 5]]
        Length: 5, dtype: interval[int64, right]
        F)rr�rrrr��flags�	writeable)r�r�s  r�rNzIndex.values�sH��L� ��:�:�D��$��
�
�+��y�y�{��',��
�
�$��K��z�z�r�c�n�|j}t|tj�rddlm}||�}|S)Nr)�NumpyExtensionArray)r�rrr�pandas.core.arrays.numpy_r�)r�r-r�s   r�r-zIndex.arrays-���
�
���e�R�Z�Z�(�E�'��.�E��r�c��|jS)a

        The best array representation.

        This is an ndarray or ExtensionArray.

        ``_values`` are consistent between ``Series`` and ``Index``.

        It may differ from the public '.values' method.

        index             | values          | _values       |
        ----------------- | --------------- | ------------- |
        Index             | ndarray         | ndarray       |
        CategoricalIndex  | Categorical     | Categorical   |
        DatetimeIndex     | ndarray[M8ns]   | DatetimeArray |
        DatetimeIndex[tz] | ndarray[M8ns]   | DatetimeArray |
        PeriodIndex       | ndarray[object] | PeriodArray   |
        IntervalIndex     | IntervalArray   | IntervalArray |

        See Also
        --------
        values : Values
        )r�r�s r�rz
Index._valuess��0�z�z�r�c�J�|j}t|t�r|jSt|t�r�|j
jdvr�ddl}|jj}|jj|�r+|j�}|jjd�S|jj|�r+|j�}|jjd�St|�t ur�t|jt"�r�t|jt$�sgt|jt�r.t'|j
�r|j
jdk7s|jj)t*�S|S)zl
        Get the ndarray or ExtensionArray that we can pass to the IndexEngine
        constructor.
        r�rN�i8rF)rrrur�ror�r r�r�rIr�r�r�r�r�r�r�rsrprLrr�)r��valsr�r�s    r�r�zIndex._get_engine_target2s&��
�|�|���d�K�(��=�=� ��d�/�0�T�Z�Z�_�_��5L� ��n�n�)�)�G��x�x�$�$�W�-��-�-�/���}�}�)�)�$�/�/����%�%�g�.��.�.�0���}�}�)�)�$�/�/���J�%���4�<�<��8��t�|�|�_�=��4�<�<�)<�=�$�T�Z�Z�0��J�J�O�O�s�*��<�<�&�&�v�.�.��r�c�8�t|jt�r|jjSt|jt�r|jj�S|j
�}t|tj�std��|S)zc
        Get the ndarray or ExtensionArray that we can pass to the join
        functions.
        z%_can_use_libjoin should return False.)
rrrpr�ro�to_numpyr�rrr.rOs  r�r�zIndex._get_join_targetTsu���d�l�l�O�4��<�<�%�%�%�
����&9�
:��<�<�(�(�*�*��(�(�*���&�"�*�*�-��D�E�E��
r�c�l�t|jt�rIt|j�|t	j
|jtj���St|jttf�r0t|j�j||j��S|S)z{
        Cast the ndarray returned from one of the libjoin.foo_indexer functions
        back to type(self._data).
        r)rrNrprIrr��shaper�rorur�r�rss  r�r�zIndex._from_join_targethsy��
�d�k�k�?�3�$�4����$�V�R�X�X�f�l�l�"�(�(�-S�T�T�
����&9�;�%G�
H�����$�3�3�F�$�*�*�3�M�M��
r�c�h�|j|��}||jj|��z
}|S)Nr�)�
_memory_usager|�sizeof)r�r�r9s   r��memory_usagezIndex.memory_usagess8���#�#��#�.��	�$�,�,�%�%�4�%�0�0���
r�c��t|t�rtd��tj|t
��}|j
||�S)a�
        Replace values where the condition is False.

        The replacement is taken from other.

        Parameters
        ----------
        cond : bool array-like with the same length as self
            Condition to select the values on.
        other : scalar, or array-like, default None
            Replacement if the condition is False.

        Returns
        -------
        pandas.Index
            A copy of self with values replaced from other
            where the condition is False.

        See Also
        --------
        Series.where : Same method for Series.
        DataFrame.where : Same method for DataFrame.

        Examples
        --------
        >>> idx = pd.Index(['car', 'bike', 'train', 'tractor'])
        >>> idx
        Index(['car', 'bike', 'train', 'tractor'], dtype='object')
        >>> idx.where(idx.isin(['car', 'train']), 'other')
        Index(['car', 'other', 'train', 'other'], dtype='object')
        z1.where is not supported for MultiIndex operationsr)rr`r@rr&r�rx)r��condr�s   r�rjzIndex.where{sD��B�d�M�*�%�C��
��z�z�$�d�+���|�|�T�E�5�)�)r�c��t|j�dt|tj�st|�n
t
|��d���)Nz5(...) must be called with a collection of some kind, z was passed)r�r�rr�genericrVr�)r�r�s  r�r$zIndex._raise_scalar_data_error�sG��
��|�|�n��'1�$��
�
�'C�T�$�Z��T��S�T�
�
�	
r�c���|j}t|tj�r|jdvr
	t	||�St|j|�st�|S#t
$r}t|�d}~wwxYw)a
        Check if the value can be inserted into our array without casting,
        and convert it to an appropriate native type if necessary.

        Raises
        ------
        TypeError
            If the value cannot be inserted into an array of this dtype.
        r�N)	r�rrr r@r:r�r;r)r�r5r�r;s    r��_validate_fill_valuezIndex._validate_fill_value�sl���
�
���e�R�X�X�&�5�:�:�T�+A�
)�*�5�%�8�8�"�$�,�,��6��O����%�
)��S�(��
)�s�A � 	A5�)A0�0A5c�,�t|j�S)zH
        Return a boolean if we need a qualified .info display.
        )rMr�r�s r��_is_memory_usage_qualifiedz Index._is_memory_usage_qualified�s���t�z�z�*�*r�c�j�t|�	||jvS#tttf$rYywxYw)a�
        Return a boolean indicating whether the provided key is in the index.

        Parameters
        ----------
        key : label
            The key to check if it is present in the index.

        Returns
        -------
        bool
            Whether the key search is in the index.

        Raises
        ------
        TypeError
            If the key is not hashable.

        See Also
        --------
        Index.isin : Returns an ndarray of boolean dtype indicating whether the
            list-like key is in the index.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3, 4])
        >>> idx
        Index([1, 2, 3, 4], dtype='int64')

        >>> 2 in idx
        True
        >>> 6 in idx
        False
        F)�hashr|�
OverflowErrorr�r.rys  r��__contains__zIndex.__contains__�s9��F	
�S�	�	��$�,�,�&�&���y�*�5�	��	�s�
�2�2zClassVar[None]�__hash__c��td��)Nz)Index does not support mutable operations�r�)r�r+r5s   r��__setitem__zIndex.__setitem__�s���C�D�Dr�c���|jj}t|�st|�rt	j
|�}||�St
|t�r|j|�St	j|�r�t
t|dd�t�r|jtd��}ntj|t��}t
|j t�sIt#|�dk(r;t#|�t#|�k7r$t%j&dt(t+���||�}|j,d	kDrt/|�|j0j3||j4�
�S)aA
        Override numpy.ndarray's __getitem__ method to work as desired.

        This function adds lists and Series as valid boolean indexers
        (ndarrays only supports ndarray with dtype=bool).

        If resulting ndim != 1, plain ndarray is returned instead of
        corresponding `Index` subclass.

        r�NF)r�r�rrz~Using a boolean indexer with length 0 on an Index with length greater than 0 is deprecated and will raise in a future version.rr=rQ)r��__getitem__rIrGr!�cast_scalar_indexerrr'�_getitem_slice�is_bool_indexerrrXrr�rr&r�r,r3r4r5r6r>r|rXr1r�)r�r+r}r9s    r�rzIndex.__getitem__�s ���*�*�(�(���c�?�h�s�m��)�)�#�.�C��3�<���c�5�!��&�&�s�+�+����s�#�
�'�#�w��5�~�F��l�l���l�>���j�j��D�1���d�j�j�.�9��s�8�q�=�S��X��T��%:��M�M�*�&�#3�#5�������;�;��?�"�6�*�� � �,�,�V�$�*�*�,�E�Er�c�.�|j|}t|�j||j|j��}d|j
vrF|jduxr|jdk}|jj|j|��|S)zH
        Fastpath for __getitem__ when we know we have a slice.
        rpr|Nr)�reverse)	r�rIr1r�rrKrxr|�_update_from_sliced)r��slobjrr9r s     r�rzIndex._getitem_slice1s~���j�j�����d��'�'��$�*�*�4�CS�CS�'�T������#��j�j��,�?����a��G��N�N�.�.�t�|�|�W�.�M��
r�c��t|j�s/t|j�st|jt�r||vSy)a]
        Faster check for ``name in self`` when we know `name` is a Python
        identifier (e.g. in NDFrame.__getattr__, which hits this to support
        . key lookup). For indexes that can't hold identifiers (everything
        but object & categorical) we just return False.

        https://github.com/pandas-dev/pandas/issues/19764
        F)rMr�rPrrV)r�r�s  r��$_can_hold_identifiers_and_holds_namez*Index._can_hold_identifiers_and_holds_name=s8��
�D�J�J�'��t�z�z�*��$�*�*�&6�7��4�<��r�c�P�|g}t|ttf�r|t|�z
}n|j|�|D]}t|t�r�td��|D�chc]}|j��}}t|�dkDrdn|j}|j||�Scc}w)a_
        Append a collection of Index options together.

        Parameters
        ----------
        other : Index or list/tuple of indices

        Returns
        -------
        Index

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx.append(pd.Index([4]))
        Index([1, 2, 3, 4], dtype='int64')
        zall inputs must be Indexr=N)	rr(r	r�r�r�r�r,�_concat)r�r��	to_concat�objrr�s      r�r�zIndex.appendOs���$�F�	��e�d�E�]�+���e��$�I�
���U�#��C��c�5�)�� :�;�;��&/�/�Y�c����Y��/��5�z�A�~�t�4�9�9���|�|�I�t�,�,��0s� B#c��|D�cgc]}|j��}}t|�}tj||��Scc}w)z5
        Concatenate multiple Index objects.
        rQ)rrTr�rV)r�r'r�r��to_concat_valsr9s      r�r&z
Index._concatssA��.7�7�Y��!�)�)�Y��7��~�.��� � ��d� �3�3��	8s�<c���t|j|�\}}|r|j�S|jtk7r"t||j�r|j}	|j|�}|jj�}t|t j"�r3t%||j'�|�}t!j|||�n|j)||�|j+|�S#tttf$rS}t|j�r|�|j|�}|j|�j||�cYd}~Sd}~wwxYw)a�
        Return a new Index of the values set with the mask.

        Returns
        -------
        Index

        See Also
        --------
        numpy.ndarray.putmask : Changes elements of an array
            based on conditional and input values.

        Examples
        --------
        >>> idx1 = pd.Index([1, 2, 3])
        >>> idx2 = pd.Index([5, 6, 7])
        >>> idx1.putmask([True, False, False], idx2)
        Index([5, 2, 3], dtype='int64')
        N)rnrrr�r�rgr�rr:r.r�rMr�rrxrrrrm�sum�_putmaskrq)r�r|r5�noop�	convertedr;r�rNs        r�rxz
Index.putmask}s��(&�d�l�l�D�9�
��d���9�9�;���:�:���$9�%����$L��N�N�E�	;��1�1�%�8�I����"�"�$���f�b�j�j�)�3�F�D�H�H�J�	�R�I��J�J�v�t�Y�/�

�O�O�D�%�(��!�!�&�)�)��'"�:�y�9�	;��t�z�z�*��	��1�1�%�8�E��;�;�u�%�-�-�d�E�:�:��
	;�s�"C=�=E$�AE�E$�E$c�p�|j|�ryt|t�syt|�t|�k7ryt|jt
�rV|jjdk(r=|j|jk7r$|j|jt��St|j�r&t|j�s|j|�St|t�r|j|�St|jt�rKt|t|��sytt|j �}|j|j �St|jt"�r|j|�St%|j|j�S)a
        Determine if two Index object are equal.

        The things that are being compared are:

        * The elements inside the Index object.
        * The order of the elements inside the Index object.

        Parameters
        ----------
        other : Any
            The other object to compare against.

        Returns
        -------
        bool
            True if "other" is an Index and it has the same elements and order
            as the calling index; False otherwise.

        Examples
        --------
        >>> idx1 = pd.Index([1, 2, 3])
        >>> idx1
        Index([1, 2, 3], dtype='int64')
        >>> idx1.equals(pd.Index([1, 2, 3]))
        True

        The elements inside are compared

        >>> idx2 = pd.Index(["1", "2", "3"])
        >>> idx2
        Index(['1', '2', '3'], dtype='object')

        >>> idx1.equals(idx2)
        False

        The order is compared

        >>> ascending_idx = pd.Index([1, 2, 3])
        >>> ascending_idx
        Index([1, 2, 3], dtype='int64')
        >>> descending_idx = pd.Index([3, 2, 1])
        >>> descending_idx
        Index([3, 2, 1], dtype='int64')
        >>> ascending_idx.equals(descending_idx)
        False

        The dtype is *not* compared

        >>> int64_idx = pd.Index([1, 2, 3], dtype='int64')
        >>> int64_idx
        Index([1, 2, 3], dtype='int64')
        >>> uint64_idx = pd.Index([1, 2, 3], dtype='uint64')
        >>> uint64_idx
        Index([1, 2, 3], dtype='uint64')
        >>> int64_idx.equals(uint64_idx)
        True
        TF�
pyarrow_numpy)ryrr�r,r�rv�storager�rr�rMr`rrsrIr
r�rXrf)r�r��earrs   r�r�zIndex.equals�s2��v�8�8�E�?���%��'���t�9��E�
�"��
�t�z�z�;�/��
�
�"�"�o�5����t�z�z�)��<�<����F� 3�4�4��4�:�:�&��u�{�{�/K��<�<��%�%��e�]�+��<�<��%�%��d�l�l�N�3��e�T�$�Z�0�����
�
�3�D��;�;�u�{�{�+�+��e�k�k�>�2��<�<��%�%�����e�m�m�<�<r�c������j��xrSt��fd��jD��xr2t��t��k(xr�j�jk(S)a=
        Similar to equals, but checks that object attributes and types are also equal.

        Returns
        -------
        bool
            If two Index objects have equal elements and same type True,
            otherwise False.

        Examples
        --------
        >>> idx1 = pd.Index(['1', '2', '3'])
        >>> idx2 = pd.Index(['1', '2', '3'])
        >>> idx2.identical(idx1)
        True

        >>> idx1 = pd.Index(['1', '2', '3'], name="A")
        >>> idx2 = pd.Index(['1', '2', '3'], name="B")
        >>> idx2.identical(idx1)
        False
        c3�T�K�|]}t�|d�t�|d�k(���!y�wr�)r)r
r�r�r�s  ��r�rz"Index.identical.<locals>.<genexpr>,s0������*�A���a��&�'�%��D�*A�A�*�s�%()r�r)r�rIr�rxs``r��	identicalzIndex.identicalsd���0
�K�K���
*����*�*���
*�
�T�
�d�5�k�)�
*��
�
�e�k�k�)�	
r�c��|j|�	|j|�}t|t�r|j	t|��d}||S#ttf$rg|j|gd��}|jdkDs|jdkDrtd��|j�}|dk(r|jcYSY||SwxYw)aB
        Return the label from the index, or, if not present, the previous one.

        Assuming that the index is sorted, return the passed index label if it
        is in the index, or return the previous index label if the passed one
        is not in the index.

        Parameters
        ----------
        label : object
            The label up to which the method returns the latest index label.

        Returns
        -------
        object
            The passed label if it is in the index. The previous label if the
            passed label is not in the sorted index or `NaN` if there is no
            such label.

        See Also
        --------
        Series.asof : Return the latest value in a Series up to the
            passed index.
        merge_asof : Perform an asof merge (similar to left join but it
            matches on nearest key rather than equal key).
        Index.get_loc : An `asof` is a thin wrapper around `get_loc`
            with method='pad'.

        Examples
        --------
        `Index.asof` returns the latest index label up to the passed label.

        >>> idx = pd.Index(['2013-12-31', '2014-01-02', '2014-01-03'])
        >>> idx.asof('2014-01-01')
        '2013-12-31'

        If the label is in the index, the method returns the passed label.

        >>> idx.asof('2014-01-02')
        '2014-01-02'

        If all of the labels in the index are later than the passed label,
        NaN is returned.

        >>> idx.asof('1999-01-02')
        nan

        If the index is not sorted, an error is raised.

        >>> idx_not_sorted = pd.Index(['2013-12-31', '2015-01-02',
        ...                            '2014-01-03'])
        >>> idx_not_sorted.asof('2013-12-31')
        Traceback (most recent call last):
        ValueError: index must be monotonic increasing or decreasing
        r�rE�r�r=z!asof requires scalar valued input)
rbr)rr'r�r,r�r�r�r>r�itemr�)r�rfr?r�s    r��asofz
Index.asof4s���r	
�$�$�U�+�	1��,�,�u�%�C��#�u�%��k�k�#�d�)�,�R�0���C�y����)�$�		&��&�&��w�u�&�=�G��|�|�a��7�<�<�!�#3�� C�D�D��,�,�.�C��b�y��~�~�%���C�y��		&�s�A�A-C�Cc�~�|j|j|jd��}tj|dkD|dz
d�}tjt|�tj��|j|�}|j|j�}d||dk(|j|kz<|S)az
        Return the locations (indices) of labels in the index.

        As in the :meth:`pandas.Index.asof`, if the label (a particular entry in
        ``where``) is not in the index, the latest index label up to the
        passed label is chosen and its index returned.

        If all of the labels in the index are later than a label in ``where``,
        -1 is returned.

        ``mask`` is used to ignore ``NA`` values in the index during calculation.

        Parameters
        ----------
        where : Index
            An Index consisting of an array of timestamps.
        mask : np.ndarray[bool]
            Array of booleans denoting where values in the original
            data are not ``NA``.

        Returns
        -------
        np.ndarray[np.intp]
            An array of locations (indices) of the labels from the index
            which correspond to the return values of :meth:`pandas.Index.asof`
            for every element in ``where``.

        See Also
        --------
        Index.asof : Return the label from the index, or, if not present, the
            previous one.

        Examples
        --------
        >>> idx = pd.date_range('2023-06-01', periods=3, freq='D')
        >>> where = pd.DatetimeIndex(['2023-05-30 00:12:00', '2023-06-01 00:00:00',
        ...                           '2023-06-02 23:59:59'])
        >>> mask = np.ones(3, dtype=bool)
        >>> idx.asof_locs(where, mask)
        array([-1,  0,  1])

        We can use ``mask`` to ignore certain values in the index during calculation.

        >>> mask[1] = False
        >>> idx.asof_locs(where, mask)
        array([-1,  0,  0])
        r��rcrr=rr�)	r�searchsortedrrjrhr,r6r��argmax)r�rjr|�locsr9�first_values      r��	asof_locszIndex.asof_locs�s���j�|�|�D�!�.�.��M�M��/�
���x�x��q��$��(�A�.�����3�t�9�B�G�G�4�T�:�?�?��E���l�l�4�;�;�=�1��>@����	�e�m�m�k�9�:�;��
r�)rfrgrhr+c��yr�r��r�rfrgrhr+s     r�rizIndex.sort_values����	r�)rgrhr+c��yr�r�rCs     r�rizIndex.sort_values�rDr�c��yr�r�rCs     r�rizIndex.sort_values�rDr�ric��|�n|r|js|s^|jrR|r@tjt	|�tj
��}|j
�|fS|j
�St|t�st||||��}n6ttt||��}|j|��}|s|ddd�}|j|�}|r||fS|S)aD
        Return a sorted copy of the index.

        Return a sorted copy of the index, and optionally return the indices
        that sorted the index itself.

        Parameters
        ----------
        return_indexer : bool, default False
            Should the indices that would sort the index be returned.
        ascending : bool, default True
            Should the index values be sorted in an ascending order.
        na_position : {'first' or 'last'}, default 'last'
            Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
            the end.
        key : callable, optional
            If not None, apply the key function to the index values
            before sorting. This is similar to the `key` argument in the
            builtin :meth:`sorted` function, with the notable difference that
            this `key` function should be *vectorized*. It should expect an
            ``Index`` and return an ``Index`` of the same shape.

        Returns
        -------
        sorted_index : pandas.Index
            Sorted copy of the index.
        indexer : numpy.ndarray, optional
            The indices that the index itself was sorted by.

        See Also
        --------
        Series.sort_values : Sort values of a Series.
        DataFrame.sort_values : Sort values in a DataFrame.

        Examples
        --------
        >>> idx = pd.Index([10, 100, 1, 1000])
        >>> idx
        Index([10, 100, 1, 1000], dtype='int64')

        Sort values in ascending order (default behavior).

        >>> idx.sort_values()
        Index([1, 10, 100, 1000], dtype='int64')

        Sort values in descending order, and also get the indices `idx` was
        sorted by.

        >>> idx.sort_values(ascending=False, return_indexer=True)
        (Index([1000, 100, 10, 1], dtype='int64'), array([3, 1, 0, 2]))
        Nr)�itemsrgrhr+)rhr�)r�r�rrhr,r6rrr`r�r
r�r�r�r�)	r�rfrgrhr+r��_asrR�sorted_indexs	         r�rizIndex.sort_values�s���z�;�
�4�7�7��$�">�">���)�)�C��I�R�W�W�=���y�y�{�G�+�+��y�y�{�"��$�
�.���i�[�c��C��u�/��c�:�;�C��+�+�+�+�6�C���$�B�$�i���y�y��~�����$�$��r�c��td��)z*
        Use sort_values instead.
        z=cannot sort an Index object in-place, use sort_values insteadr�r�rTrUs   r�r�z
Index.sort<s��
�W�X�Xr�c�D�tdt|�j����)a�
        Shift index by desired number of time frequency increments.

        This method is for shifting the values of datetime-like indexes
        by a specified time increment a given number of times.

        Parameters
        ----------
        periods : int, default 1
            Number of periods (or increments) to shift by,
            can be positive or negative.
        freq : pandas.DateOffset, pandas.Timedelta or str, optional
            Frequency increment to shift by.
            If None, the index is shifted by its own `freq` attribute.
            Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

        Returns
        -------
        pandas.Index
            Shifted index.

        See Also
        --------
        Series.shift : Shift values of Series.

        Notes
        -----
        This method is only implemented for datetime-like index classes,
        i.e., DatetimeIndex, PeriodIndex and TimedeltaIndex.

        Examples
        --------
        Put the first 5 month starts of 2011 into an index.

        >>> month_starts = pd.date_range('1/1/2011', periods=5, freq='MS')
        >>> month_starts
        DatetimeIndex(['2011-01-01', '2011-02-01', '2011-03-01', '2011-04-01',
                       '2011-05-01'],
                      dtype='datetime64[ns]', freq='MS')

        Shift the index by 10 days.

        >>> month_starts.shift(10, freq='D')
        DatetimeIndex(['2011-01-11', '2011-02-11', '2011-03-11', '2011-04-11',
                       '2011-05-11'],
                      dtype='datetime64[ns]', freq=None)

        The default value of `freq` is the `freq` attribute of the index,
        which is 'MS' (month start) in this example.

        >>> month_starts.shift(10)
        DatetimeIndex(['2011-11-01', '2011-12-01', '2012-01-01', '2012-02-01',
                       '2012-03-01'],
                      dtype='datetime64[ns]', freq='MS')
        z\This method is only implemented for DatetimeIndex, PeriodIndex and TimedeltaIndex; Got type )r@rIr�)r��periods�freqs   r��shiftzIndex.shiftCs,��p"�(�(,�T�
�(;�(;�'<�
>�
�	
r�c�:�|jj|i|��S)aK
        Return the integer indices that would sort the index.

        Parameters
        ----------
        *args
            Passed to `numpy.ndarray.argsort`.
        **kwargs
            Passed to `numpy.ndarray.argsort`.

        Returns
        -------
        np.ndarray[np.intp]
            Integer indices that would sort the index if used as
            an indexer.

        See Also
        --------
        numpy.argsort : Similar method for NumPy arrays.
        Index.sort_values : Return sorted copy of Index.

        Examples
        --------
        >>> idx = pd.Index(['b', 'a', 'd', 'c'])
        >>> idx
        Index(['b', 'a', 'd', 'c'], dtype='object')

        >>> order = idx.argsort()
        >>> order
        array([1, 0, 3, 2])

        >>> idx[order]
        Index(['a', 'b', 'c', 'd'], dtype='object')
        )r�r�rLs   r�r�z
Index.argsort�s!��J"�t�z�z�!�!�4�2�6�2�2r�c�0�t|�st|��yr�)rNr1rys  r�r*zIndex._check_indexing_error�s����~�$�C�(�(�r�c��|jdvS)zA
        Should an integer key be treated as positional?
        >�complexr�r�r�r�r�s r�r�z$Index._should_fallback_to_positional�s��
�!�!�*
�
�	
r�a:
        Compute indexer and mask for new index given the current index.

        The indexer should be then used as an input to ndarray.take to align the
        current data to the new index.

        Parameters
        ----------
        target : %(target_klass)s

        Returns
        -------
        indexer : np.ndarray[np.intp]
            Integers from 0 to n - 1 indicating that the index at these
            positions matches the corresponding target values. Missing values
            in the target are marked by -1.
        missing : np.ndarray[np.intp]
            An indexer into the target of the values not found.
            These correspond to the -1 in the indexer array.

        Examples
        --------
        >>> index = pd.Index(['c', 'b', 'a', 'b', 'b'])
        >>> index.get_indexer_non_unique(['b', 'b'])
        (array([1, 3, 4, 1, 3, 4]), array([], dtype=int64))

        In the example below there are no matched values.

        >>> index = pd.Index(['c', 'b', 'a', 'b', 'b'])
        >>> index.get_indexer_non_unique(['q', 'r', 't'])
        (array([-1, -1, -1]), array([0, 1, 2]))

        For this reason, the returned ``indexer`` contains only integers equal to -1.
        It demonstrates that there's no match between the index and the ``target``
        values at these positions. The mask [0, 1, 2] in the return value shows that
        the first, second, and third elements are missing.

        Notice that the return value is a tuple contains two items. In the example
        below the first item is an array of locations in ``index``. The second
        item is a mask shows that the first and third elements are missing.

        >>> index = pd.Index(['c', 'b', 'a', 'b', 'b'])
        >>> index.get_indexer_non_unique(['f', 'b', 's'])
        (array([-1,  1,  3,  4, -1]), array([0, 2]))
        r�c��t|�}|j|�}|j|�s%|j|�s|j	|dd��S|j|�\}}||us||ur|j
|�S|j|jk7rH|j|�}|j|d��}|j|d��}|j
|�S|jr*|jr|j}|j|�}n|j�}|jj
|�\}	}
t|	�t|
�fS)NFr.r)r�r3r�r7r8r:r�r�r�rrRr|rKr�rC)r�r<rArBr�r�rrLrMr�r�s           r�r�zIndex.get_indexer_non_unique�sH���f�%���2�2�6�:���#�#�F�+�D�4N�4N�v�4V��3�3�F�4�PU�3�V�V��:�:�6�B���w�����v� 5��/�/��8�8��:�:����%��1�1�&�9�E��;�;�u�5�;�1�D��=�=��U�=�3�D��.�.�t�4�4��>�>�f�.�.��\�\�F� �4�4�V�<�J��2�2�4�J��<�<�>�>�z�J����"�7�+�-@��-I�I�Ir�c�h�|jr|j|�S|j|�\}}|S)a�
        Guaranteed return of an indexer even when non-unique.

        This dispatches to get_indexer or get_indexer_non_unique
        as appropriate.

        Returns
        -------
        np.ndarray[np.intp]
            List of indices.

        Examples
        --------
        >>> idx = pd.Index([np.nan, 'var1', np.nan])
        >>> idx.get_indexer_for([np.nan])
        array([0, 2])
        )r�r�r�)r�r<r�rs    r�r	zIndex.get_indexer_fors7��&� � ��#�#�F�+�+��0�0��8�
����r�c�h�|}t|t�stj|�}|jr&|j|�}|j
|�d}n|j|�\}}}|j|||�|j|�}t|t�r|j|_
tj|jd�st|jt�rBt|t�s!t|t!|��r|j"�|j%d�}||fS)zR
        Analogue to get_indexer that raises if any elements are missing.
        rr�N)rr�r!r"r�r	r�r��_raise_if_missingr�r�rrr�rWr(rIrO�
_with_freq)r�r+�	axis_name�keyarrr�r�s      r��_get_indexer_strictzIndex._get_indexer_strict*s������&�%�(��*�*�6�2�F�� � ��*�*�6�2�G��\�\�&�)�!�,�F�+/�+C�+C�F�+K�(�F�G�[����v�w�	�:����7�#���c�5�!��(�(�F�K��?�?�6�<�<��.�*��L�L�/�3
��#�t�$��3��T�
�+��H�H�$��*�*�4�0���w��r�c��t|�dk(ry|dk}|j�}|rd|t|�k(rtd|�d|�d���tt	|�|j�dj
��}t|�d���y)a8
        Check that indexer can be used to return a result.

        e.g. at least one element was found,
        unless the list of keys was actually empty.

        Parameters
        ----------
        key : list-like
            Targeted labels (only used to show correct error message).
        indexer: array-like of booleans
            Indices corresponding to the key,
            (with -1 indicating not found).
        axis_name : str

        Raises
        ------
        KeyError
            If at least one key was requested but none was found.
        rNz	None of [z] are in the [�]z
 not in index)r,r,r�r(r�r�r�)r�r+r�rZ�missing_mask�nmissing�	not_founds       r�rXzIndex._raise_if_missingKs���*�s�8�q�=����{���#�#�%����3�w�<�'���3�%�~�i�[��J�K�K��\�#�.�|�/C�/C�/E�a�/H�I�P�P�R�S�I��i�[�
�6�7�7�r�c��yr�r��r�r<r�r�s    r�r8z!Index._get_indexer_non_comparablen���	r�c��yr�r�rcs    r�r8z!Index._get_indexer_non_comparabletrdr�c��yr�r�rcs    r�r8z!Index._get_indexer_non_comparablezrdr�c�"�|�&t|�}td|j�d|����dtj|j
tj��z}|r|Stjt|�tj��}||fS)a
        Called from get_indexer or get_indexer_non_unique when the target
        is of a non-comparable dtype.

        For get_indexer lookups with method=None, get_indexer is an _equality_
        check, so non-comparable dtypes mean we will always have no matches.

        For get_indexer lookups with a method, get_indexer is an _inequality_
        check, so non-comparable dtypes mean we will always raise TypeError.

        Parameters
        ----------
        target : Index
        method : str or None
        unique : bool, default True
            * True if called from get_indexer.
            * False if called from get_indexer_non_unique.

        Raises
        ------
        TypeError
            If doing an inequality check, i.e. method is not None.
        zCannot compare dtypes z and r�r)	r�r�r�r�onesrr6rhr,)r�r<r�r��other_dtype�
no_matchesr�s       r�r8z!Index._get_indexer_non_comparable�s|��6��.�v�6�K��4�T�Z�Z�L��k�]�S�T�T��"�'�'�&�,�,�b�g�g�>�>�
�����i�i��F��2�7�7�;�G��w�&�&r�c��|jS)z�
        Whether we should treat this as unique for the sake of
        get_indexer vs get_indexer_non_unique.

        For IntervalIndex compat.
        r�r�s r�r�zIndex._index_as_unique�s���~�~�r�z8Reindexing only valid with uniquely valued Index objectsc���t|t�rmt|t�r]|j��J|j��=t|j|j��s|j	d�|j	d�fS|j
dk(r$t|t�r	t
|�|�|fS|j
dk(r#t|t�rt
|�|�|fS|jjdk(rI|jjdk(r0|j�dk\rP||j|j�fS|jr'|js	t
|�j|�}t'|j�s)t'|j�r|j)|�\}}||fS#t$r||fcYSwxYw#tt f$rt#|j$�}Y�{wxYw)z�
        When dealing with an object-dtype Index and a non-object Index, see
        if we can upcast the object-dtype one to improve performance.
        r��date�	timedelta�urQr)rr^r�rr�r�rIrrdr�r �minrrRr+r�r.r�rrMr:rxs  r�r:z"Index._maybe_downcast_for_indexing�s����d�,�-�*�U�DT�2U����#��H�H�(�"�4�7�7�E�H�H�5����u�-�u�/?�/?��/F�F�F�
�
�
�6�
)�j��@P�.Q�
#�"�t�E�{�4�(�%�/�/��
�
�;�
.�:�e�EV�3W��4��;�t�$�e�+�+�
�Z�Z�_�_��
#����(8�(8�C�(?��y�y�{�a���U�\�\�$�*�*�5�5�5�
�^�^�E�O�O�
+��T�
�.�.�u�5��
�t�z�z�*��u�{�{�/K��<�<�T�B�K�E�4��U�{���3'�
#��U�{�"�
#��"�z�*�
+��T�\�\�*��
+�s$�F:�G
�:
G
�	G
�
$G4�3G4c���t|�\}}|jdk(s|dk(r&t|j�st|�rtSt	|j|�}t||g|�}|S)zk
        Implementation of find_common_type that adjusts for Index-specific
        special cases.
        �uint64)r>r�rOr#r=r<)r�r<�target_dtyperr�s     r�r�zIndex._find_common_type_compat�sk��+�6�2���a��:�:��!�\�X�%=�&�t�z�z�2�6M��7�"�!� ����V�4��/��v���F���r�c���|jdk(rt|j�s$|jdk(rt|j�ryt|�}|j	|�xst|�S)zK
        Check if `self == other` can ever have non-False entries.
        r�F)r�rDr�r��_is_comparable_dtyperM)r�r�r�s   r�r�zIndex._should_compare�sb��
���9�,�1J�4�:�:�1V����)�+�0I�%�+�+�0V�
�$�U�+���(�(��/�I�?�5�3I�Ir�c��|jjdk(r|jdk(St|j�rt|�Sy)zF
        Can we compare values of the given dtype to our own?
        �bT)r�r rLr�s  r�ruzIndex._is_comparable_dtypes?���:�:�?�?�c�!��:�:��$�$�
�d�j�j�
)�#�E�*�*�r�c��t|t�r|j}t|�}|j	�}|j�D��cic]\}}||j
|���}}}t|�Scc}}w)a

        Group the index labels by a given array of values.

        Parameters
        ----------
        values : array
            Values used to determine the groups.

        Returns
        -------
        dict
            {group name -> group labels}
        )rr`rrq�_reverse_indexerrHr�r�)r�rNr9r�r�s     r�riz
Index.groupbysk��"�f�m�,��^�^�F��V�$���(�(�*��/5�l�l�n�=�n�d�a��!�T�Y�Y�q�\�/�n��=��&�!�!��>s�A5c��ddlm}|j||��}|jrkt	|dt
�rXt	||�r
|j}n+|jr|jgt|d�z}nd}|j||��Sd}|js|j}tj|d��|jk(}|rt||j|��}tj!||d|j�	�S)
a&
        Map values using an input mapping or function.

        Parameters
        ----------
        mapper : function, dict, or Series
            Mapping correspondence.
        na_action : {None, 'ignore'}
            If 'ignore', propagate NA values, without passing them to the
            mapping correspondence.

        Returns
        -------
        Union[Index, MultiIndex]
            The output of the mapping function applied to the index.
            If the function returns a tuple with more than one element
            a MultiIndex will be returned.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx.map({1: 'a', 2: 'b', 3: 'c'})
        Index(['a', 'b', 'c'], dtype='object')

        Using `map` with a function:

        >>> idx = pd.Index([1, 2, 3])
        >>> idx.map('I am a {}'.format)
        Index(['I am a 1', 'I am a 2', 'I am a 3'], dtype='object')

        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.map(lambda x: x.upper())
        Index(['A', 'B', 'C'], dtype='object')
        rr)�	na_actionNrFr�)�
same_dtyper)r*r��_map_valuesrrr	rr�r,r+r�rr�r�r?r�rV)r��mapperr{r�r�rr�r|s        r�rz	Index.map6s���F	9��%�%�f�	�%�B�
��?�?�z�*�Q�-��?��$�
�+��
�
���������c�*�Q�-�&8�8����)�:�)�)�*�E�B�B�������J�J�E�
�_�_�Z��>�$�BT�BT�T�
��4��D�J�J�:��J�� � ��5�u�4�9�9� �U�Ur�c�t�t|t�rrt|j�D�cgc]:}||k(s|� |j	|�j|�n|j	|���<}}t
|�j|�S|D�cgc]
}||���}}t||jd��Scc}wcc}w)z�
        Apply function to all values found in index.

        This includes transforming multiindex entries separately.
        Only apply function to one level of the MultiIndex if level is specified.
        F)r�r6)
rr`rrk�get_level_valuesrrI�from_arraysr�r�)r��funcr�rQrNr�rHs       r��_transform_indexzIndex._transform_indexxs����d�M�*�
�t�|�|�,�	�-�A���:����%�%�a�(�,�,�T�2��*�*�1�-�.�-�	
����:�)�)�&�1�1�&*�+�d��T�!�W�d�E�+���T�Y�Y�e�D�D����,s�?B0�B5c�h�|�|j|�tj|j|�S)a�
        Return a boolean array where the index values are in `values`.

        Compute boolean array of whether each index value is found in the
        passed set of values. The length of the returned boolean array matches
        the length of the index.

        Parameters
        ----------
        values : set or list-like
            Sought values.
        level : str or int, optional
            Name or position of the index level to use (if the index is a
            `MultiIndex`).

        Returns
        -------
        np.ndarray[bool]
            NumPy array of boolean values.

        See Also
        --------
        Series.isin : Same for Series.
        DataFrame.isin : Same method for DataFrames.

        Notes
        -----
        In the case of `MultiIndex` you must either specify `values` as a
        list-like object containing tuples that are the same length as the
        number of levels, or specify `level`. Otherwise it will raise a
        ``ValueError``.

        If `level` is specified:

        - if it is the name of one *and only one* index level, use that level;
        - otherwise it should be a number indicating level position.

        Examples
        --------
        >>> idx = pd.Index([1,2,3])
        >>> idx
        Index([1, 2, 3], dtype='int64')

        Check whether each index value in a list of values.

        >>> idx.isin([1, 4])
        array([ True, False, False])

        >>> midx = pd.MultiIndex.from_arrays([[1,2,3],
        ...                                  ['red', 'blue', 'green']],
        ...                                  names=('number', 'color'))
        >>> midx
        MultiIndex([(1,   'red'),
                    (2,  'blue'),
                    (3, 'green')],
                   names=['number', 'color'])

        Check whether the strings in the 'color' level of the MultiIndex
        are in a list of colors.

        >>> midx.isin(['red', 'orange', 'yellow'], level='color')
        array([ True, False, False])

        To check across the levels of a MultiIndex, pass a list of tuples:

        >>> midx.isin([(1, 'red'), (3, 'red')])
        array([ True, False, False])
        )rar�isinrrDs   r�r�z
Index.isin�s.��J���&�&�u�-��z�z�$�,�,��/�/r�c��t�r�)r@rys  r��_get_string_slicezIndex._get_string_slice�s
��"�!r�c��|j|||��\}}t|�std��t|�std��t|||�S)a�
        Compute the slice indexer for input labels and step.

        Index needs to be ordered and unique.

        Parameters
        ----------
        start : label, default None
            If None, defaults to the beginning.
        end : label, default None
            If None, defaults to the end.
        step : int, default None

        Returns
        -------
        slice

        Raises
        ------
        KeyError : If key does not exist, or key is not unique and index is
            not ordered.

        Notes
        -----
        This function assumes that the data is sorted, so use at your own peril

        Examples
        --------
        This is a method on all index types. For example you can do:

        >>> idx = pd.Index(list('abcd'))
        >>> idx.slice_indexer(start='b', end='c')
        slice(1, 3, None)

        >>> idx = pd.MultiIndex.from_arrays([list('abcd'), list('efgh')])
        >>> idx.slice_indexer(start='b', end=('c', 'g'))
        slice(1, 3, None)
        )rxzStart slice bound is non-scalarzEnd slice bound is non-scalar)�
slice_locsrN�AssertionErrorr')r�r�endrx�start_slice�	end_slices      r�r�zIndex.slice_indexer�sW��X"&�����$��!G���Y���%� �!B�C�C���#� �!@�A�A��[�)�T�2�2r�c��|S)zx
        If we have a float key and are not a floating index, then try to cast
        to an int if equivalent.
        r�rys  r�r(zIndex._maybe_cast_indexers	��
�
r�c��t|�S)zT
        Analogue to maybe_cast_indexer for get_indexer instead of get_loc.
        )r�rOs  r�r3z"Index._maybe_cast_listlike_indexers���F�#�#r�c�T�tj|�s|j||�yy)zz
        If we are positional indexer, validate that we have appropriate
        typed bounds must be an integer.
        N)r�is_int_or_noner�)r�r�r+r s    r�rvzIndex._validate_indexers'���!�!�#�&��'�'��c�2�'r�c��t|j�r|j|�St|�st	|�r||vr|jd|�|S)a�
        This function should be overloaded in subclasses that allow non-trivial
        casting on label-slice bounds, e.g. datetime-like indices allowing
        strings containing formatted datetimes.

        Parameters
        ----------
        label : object
        side : {'left', 'right'}

        Returns
        -------
        label : object

        Notes
        -----
        Value of `side` parameter should be validated in caller.
        r')rLr�r(rGrIr�)r�rfrcs   r��_maybe_cast_slice_boundzIndex._maybe_cast_slice_bound+sM��.�D�J�J�'��+�+�E�2�2�
�U�O�z�%�0�e�4�6G��'�'���7��r�c���|jr|j||��S|jr.|ddd�j||dk(rdnd��}t|�|z
St	d��)Nr<r�r�r�rX)r�r=r�r,r.)r�rfrc�poss    r�rbzIndex._searchsorted_monotonicKsr���'�'��$�$�U��$�6�6�
�
)�
)��t��t�*�)�)��t�v�~�G�6�*��C��t�9�s�?�"��K�L�Lr�c�f�|dvrtd|����|}|j||�}	|j|�}t|tj�rot|j�sJ�tj|jd��}t|tj�rtd|�dt|�����t|t�r|dk(r|jS|j S|dk(r|d	zS|S#t$r,}	|j	||�cYd}~S#t$r|�wxYwd}~wwxYw)
a�
        Calculate slice bound that corresponds to given label.

        Returns leftmost (one-past-the-rightmost if ``side=='right'``) position
        of given label.

        Parameters
        ----------
        label : object
        side : {'left', 'right'}

        Returns
        -------
        int
            Index of label.

        See Also
        --------
        Index.get_loc : Get integer location, slice or boolean mask for requested
            label.

        Examples
        --------
        >>> idx = pd.RangeIndex(5)
        >>> idx.get_slice_bound(3, 'left')
        3

        >>> idx.get_slice_bound(3, 'right')
        4

        If ``label`` is non-unique in the index, an error will be raised.

        >>> idx_duplicate = pd.Index(['a', 'b', 'a', 'c', 'd'])
        >>> idx_duplicate.get_slice_bound('a', 'left')
        Traceback (most recent call last):
        KeyError: Cannot get left slice bound for non-unique label: 'a'
        r�z@Invalid value for side kwarg, must be either 'left' or 'right': N�u1zCannot get z# slice bound for non-unique label: r�r�r=)r.r�r)r�rbrrrrEr�r�maybe_booleans_to_slicer�rVr'rrw)r�rfrc�original_label�slcr;s      r��get_slice_boundzIndex.get_slice_boundYsC��N�(�(��&�&*�V�-��
�
���,�,�U�D�9��	��,�,�u�%�C��c�2�:�:�&�!����+�+�+��-�-�c�h�h�t�n�=�C��#�r�z�z�*��!�$��(�"�>�2�3�5���
�c�5�!��v�~��y�y� ��x�x���w���Q�w���
��7�	�
��3�3�E�4�@�@���
��	�
��	�s)�C;�;	D0�D�D0�D(�(D+�+D0c��|duxs|dk\}|s||}}t|ttf�rXt|ttf�rB	t|�}t|�}t	|j
|j
�st
d��d}|�|j|d�}|�d}d}|�|j|d�}|�t|�}|s0|dz
|dz
}}|dk(r|t|�z}|dk(r|t|�z}||fS#ttf$rY��wxYw)a�
        Compute slice locations for input labels.

        Parameters
        ----------
        start : label, default None
            If None, defaults to the beginning.
        end : label, default None
            If None, defaults to the end.
        step : int, defaults None
            If None, defaults to 1.

        Returns
        -------
        tuple[int, int]

        See Also
        --------
        Index.get_loc : Get location for a single label.

        Notes
        -----
        This method only works if the index is monotonic or unique.

        Examples
        --------
        >>> idx = pd.Index(list('abcd'))
        >>> idx.slice_locs(start='b', end='c')
        (1, 3)
        Nrz(Both dates must have the same UTC offsetr�r�r=r�)
rr�rrr�tzinfor.r�r�r,)	r�rr�rx�inc�ts_start�ts_endr�r�s	         r�r�zIndex.slice_locs�s3��>�d�l�'�d�a�i����e�3�E��e�c�8�_�-�*�S�3��/�2R�
Q�$�U�+��"�3���"�(�/�/�6�=�=�A�$�%O�P�P������.�.�u�f�=�K����K��	��?��,�,�S�'�:�I����D�	�I��&1�1�_�i�!�m�{�I�
�B���S��Y�&�	��b� ��s�4�y�(���I�%�%��W�	�*�
��
�s�C3�3D�Dc���|j}t|tj�rtj||�}n|j	|�}|j
j
||j��S)a�
        Make new Index with passed location(-s) deleted.

        Parameters
        ----------
        loc : int or list of int
            Location of item(-s) which will be deleted.
            Use a list of locations to delete more than one value at the same time.

        Returns
        -------
        Index
            Will be same type as self, except for RangeIndex.

        See Also
        --------
        numpy.delete : Delete any rows and column from NumPy array (ndarray).

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.delete(1)
        Index(['a', 'c'], dtype='object')

        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.delete([0, 2])
        Index(['b'], dtype='object')
        rQ)rrrr�deleterXr1r�)r�r?rNr�s    r�r�zIndex.deletes[��:�����f�b�j�j�)����6�3�/�J����s�+�J�� � �,�,�Z�d�i�i�,�H�Hr�c��tj|�}t||j�r|jtk7r|j
}|j}	t|t�r8|j||�}t|�j||j��S|j|�}	|jtk7s/t|t&t(j*t(j,f�s3|jj|�}t)j|||�}n(t)j||d�}|dk\r|n|dz
}|||<t.j1||j��}t3�rCt5|j�r.|jtk(r|j%|j�}|jtk(r7|jtk7r$t7j8dt:t=���|S#ttt f$r5|j#|�}|j%|�j||�cYSwxYw)a�
        Make new Index inserting new item at location.

        Follows Python numpy.insert semantics for negative values.

        Parameters
        ----------
        loc : int
        item : object

        Returns
        -------
        Index

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.insert(1, 'x')
        Index(['a', 'x', 'b', 'c'], dtype='object')
        rQNrr=z�The behavior of Index.insert with object-dtype is deprecated, in a future version this will return an object-dtype Index instead of inferring a non-object dtype. To retain the old behavior, do `idx.insert(loc, item).infer_objects(copy=False)`r)rr�rgr�r�r�rrrs�insertrIr1r�rr�r.r:r�rr	r�
datetime64�timedelta64r�rVrrPr3r4r5r6)	r�r?r9r:r�r��castedr�rns	         r�r�zIndex.insert,s���*�$�$�T�*�� ��t�z�z�2�t�z�z�V�7K��>�>�D��l�l��	8��#�~�.� �Z�Z��T�2�
��D�z�-�-�j�t�y�y�-�I�I��0�0��6���9�9���j��5�"�-�-����8�'
��Y�Y�^�^�D�)�F����3��V�4�J�
���3��T�2�J����#�s�Q�w�C�"�J�s�O����
�����;��&�(���	�	�*�� � �F�*��*�*�Z�-�-�.�C��:�:���C�I�I��$7��M�M�Q��+�-�

��
��Q�:�'8�9�	8��1�1�$�7�E��;�;�u�%�,�,�S�$�7�7�	8�s�AH	� H	�	AI�Ic�8�t|t�s*|jdk(rdnd}tj||��}|j|�}|dk(}|j
�r*|dk7rt||j��d���||}|j|�S)a�
        Make new Index with passed list of labels deleted.

        Parameters
        ----------
        labels : array-like or scalar
        errors : {'ignore', 'raise'}, default 'raise'
            If 'ignore', suppress error and existing labels are dropped.

        Returns
        -------
        Index
            Will be same type as self, except for RangeIndex.

        Raises
        ------
        KeyError
            If not all of the labels are found in the selected axis

        Examples
        --------
        >>> idx = pd.Index(['a', 'b', 'c'])
        >>> idx.drop(['a'])
        Index(['b', 'c'], dtype='object')
        r�Nrr��ignorez not found in axis)
rr�r�r!�index_labels_to_arrayr	r�r��tolistr�)r�r��errors�	arr_dtyper�r|s      r��dropz
Index.dropws���<�&�%�(�$(�J�J�(�$:���I��.�.�v�Y�G�F��&�&�v�.���"�}���8�8�:���!��&��,�"5�"5�"7�!8�8J�K�L�L��t�e�n�G��{�{�7�#�#r�c��|jrtd��|jtk7r|r|j	�S|S|j
}t
d|�}tj|d��}|r||ur|j	�St||j��}|s<||ur8|j�,|j|_|jj|�|S)z�
        If we have an object dtype, try to infer a non-object dtype.

        Parameters
        ----------
        copy : bool, default True
            Whether to make a copy in cases where no inference occurs.
        z^infer_objects is not implemented for MultiIndex. Use index.to_frame().infer_objects() instead.�npt.NDArray[np.object_]T)�convert_non_numericrQ)
rRr@r�r�rrr
rrSr�r�rrM)r�rrNr�r9s     r��
infer_objectszIndex.infer_objects�s����>�>�%�@��
��:�:���"&�4�9�9�;�0�D�0������/��8���.�.�� $�
�
��J�&�(��9�9�;���z��	�	�2���
�f�,��1A�1A�1M�!%�!1�!1�F�����2�2�6�:��
r�c�R�t|j�j|��S)a�
        Computes the difference between consecutive values in the Index object.

        If periods is greater than 1, computes the difference between values that
        are `periods` number of positions apart.

        Parameters
        ----------
        periods : int, optional
            The number of positions between the current and previous
            value to compute the difference with. Default is 1.

        Returns
        -------
        Index
            A new Index object with the computed differences.

        Examples
        --------
        >>> import pandas as pd
        >>> idx = pd.Index([10, 20, 30, 40, 50])
        >>> idx.diff()
        Index([nan, 10.0, 10.0, 10.0, 10.0], dtype='float64')

        )r�r0rr)r�rNs  r�rrz
Index.diff�s!��6�T�^�^�%�*�*�7�3�4�4r�c�^�|j|j�j|��S)a�
        Round each value in the Index to the given number of decimals.

        Parameters
        ----------
        decimals : int, optional
            Number of decimal places to round to. If decimals is negative,
            it specifies the number of positions to the left of the decimal point.

        Returns
        -------
        Index
            A new Index with the rounded values.

        Examples
        --------
        >>> import pandas as pd
        >>> idx = pd.Index([10.1234, 20.5678, 30.9123, 40.4567, 50.7890])
        >>> idx.round(decimals=2)
        Index([10.12, 20.57, 30.91, 40.46, 50.79], dtype='float64')

        )rXr0�round)r��decimalss  r�r�zIndex.round�s'��0� � ����!1�!7�!7��!A�B�Br�c��|j|�r�|tjtjtjhvrUtjt|�t��}|jr#t|t�sd||j�<|S|tjurUtjt|�t��}|jr#t|t�sd||j�<|St|t
jt t"t$f�r"t|�t|�k7rt'd��t|t�st)|d��}ntj*|�}t-|j.�r%t|t$�r||j0|�}|St|j0t$�r||j0|�}|St-|j.�r3t|t�s#t3j4||j0|�}|St3j6|j0||�}|S)zA
        Wrapper used to dispatch comparison operations.
        rFTzLengths must match to compare)�
extract_numpy)ryrg�eqri�gerrhr,r�r�rr`rh�ner�rr�rcrsr.rzr&rMr�rrk�comp_method_OBJECT_ARRAY�
comparison_op)r�r�rmr:r9s     r��_cmp_methodzIndex._cmp_method�s����8�8�E�?��h�k�k�8�;�;����<�<��g�g�c�$�i�t�4���$�$�Z��m�-L�',�C��	�	��$��
��x�{�{�"��h�h�s�4�y��5���$�$�Z��m�-L�'+�C��	�	��$��
��e�b�j�j�%��N�K�L�QT��R
�
��Z�R��<�=�=��%��/�!�%�t�<�E��J�J�u�%�E��4�:�:�&�:�e�^�+L�����e�,�F��
�����n�
5�����e�,�F��
��T�Z�Z�
(��D�-�1P��1�1�"�d�l�l�E�J�F�
�
��&�&�t�|�|�U�B�?�F��
r�c��tj||�}|j}t|dd��}tj|||�}|j||��S)NT)r��
extract_rangerQ)rkr�rrz�
logical_op�_construct_result)r�r�rm�res_name�lvalues�rvaluesr�s       r��_logical_methodzIndex._logical_method(sS���)�)�$��6���,�,����T��N���^�^�G�W�b�9�
��%�%�j�x�%�@�@r�c���t|t�r<t|d||dj��t|d||dj��fSt|||j��S)Nrrr=)rr	r�r�)r�r9r�s   r�r�zIndex._construct_result2s[���f�e�$��f�Q�i�d�&��)�/�/�B��f�Q�i�d�&��)�/�/�B��
��V�$�f�l�l�;�;r�c���t|t�r,t|j�rt	|�turt
St�|�||�Sr�)rr�rMr�rIr�r��
_arith_method)r�r�rmr�s   �r�r�zIndex._arith_method;s?����u�e�$�����,��U��5�(�
"�!��w�$�U�B�/�/r�c�T�||j�}t||j��Sr�)rr�r�)r�rmr9s   r��
_unary_methodzIndex._unary_methodHs!���D�L�L�!���V�$�)�)�,�,r�c�@�|jtj�Sr�)r�rgrqr�s r��__abs__z
Index.__abs__M����!�!�(�,�,�/�/r�c�@�|jtj�Sr�)r�rg�negr�s r��__neg__z
Index.__neg__Pr�r�c�@�|jtj�Sr�)r�rgr�r�s r��__pos__z
Index.__pos__Sr�r�c�@�|jtj�Sr�)r�rg�invr�s r��
__invert__zIndex.__invert__Vs���!�!�(�,�,�/�/r�c���tj||�|jd�|j}t	|t
j�s|jd�Stj|�S)an
        Return whether any element is Truthy.

        Parameters
        ----------
        *args
            Required for compatibility with numpy.
        **kwargs
            Required for compatibility with numpy.

        Returns
        -------
        bool or array-like (if axis is specified)
            A single element array-like may be converted to bool.

        See Also
        --------
        Index.all : Return whether all elements are True.
        Series.all : Return whether all elements are True.

        Notes
        -----
        Not a Number (NaN), positive infinity and negative infinity
        evaluate to True because these are not equal to zero.

        Examples
        --------
        >>> index = pd.Index([0, 1, 2])
        >>> index.any()
        True

        >>> index = pd.Index([0, 0, 0])
        >>> index.any()
        False
        r�)	r��validate_any�_maybe_disable_logical_methodsrrrr�_reducer��r�rTrUrs    r�r�z	Index.any]sW��H	����f�%��+�+�E�2��|�|���$��
�
�+��<�<��&�&��v�v�d�|�r�c���tj||�|jd�|j}t	|t
j�s|jd�Stj|�S)a
        Return whether all elements are Truthy.

        Parameters
        ----------
        *args
            Required for compatibility with numpy.
        **kwargs
            Required for compatibility with numpy.

        Returns
        -------
        bool or array-like (if axis is specified)
            A single element array-like may be converted to bool.

        See Also
        --------
        Index.any : Return whether any element in an Index is True.
        Series.any : Return whether any element in a Series is True.
        Series.all : Return whether all elements in a Series are True.

        Notes
        -----
        Not a Number (NaN), positive infinity and negative infinity
        evaluate to True because these are not equal to zero.

        Examples
        --------
        True, because nonzero integers are considered True.

        >>> pd.Index([1, 2, 3]).all()
        True

        False, because ``0`` is considered False.

        >>> pd.Index([0, 1, 2]).all()
        False
        r))	r��validate_allr�rrrrr�r)r�s    r�r)z	Index.all�sW��N	����f�%��+�+�E�2��|�|���$��
�
�+��<�<��&�&��v�v�d�|�r�c��t|t�s.t|j�r,|jjdk7rt|�|�yyy)zK
        raise if this Index subclass does not support any or all.
        rDN)rr`rQr�r r�)r��opnames  r�r�z$Index._maybe_disable_logical_methods�sE��
�t�]�+�$�D�J�J�/�D�J�J�O�O�s�4J�
$�O�F�#�D�)�5K�/r�c�^��tj||�tj|�|jsf|jrZ|j
}|r|j
�r<tjdt|�j�d�tt���yt�|�9|��S�NzThe behavior of zx.argmax/argmin with skipna=False and NAs, or with all-NAs is deprecated. In a future version this will raise ValueError.rr�r�)r��validate_argmin�validate_minmax_axisrRr�r�r)r3r4rIr�r5r6r��argmin�r�r�r�rTrUr|r�s      �r�r�zIndex.argmin�����
���4��(�
����%��~�~�$�,�,��;�;�D��T�X�X�Z��
�
�&�t�D�z�':�':�&;�<F�F�"�/�1����w�~�V�~�,�,r�c�^��tj||�tj|�|jsf|jrZ|j
}|r|j
�r<tjdt|�j�d�tt���yt�|�9|��Sr�)r��validate_argmaxr�rRr�r�r)r3r4rIr�r5r6r�r>r�s      �r�r>zIndex.argmax�r�r�c�8�tj||�tj|�t|�s|jSt|�r|j
r|d}t
|�s|S|js6|jr*|j}|r|j�r|jS|jsAt|jtj�s|jjd|��St!j"|j|��S)a
        Return the minimum value of the Index.

        Parameters
        ----------
        axis : {None}
            Dummy argument for consistency with Series.
        skipna : bool, default True
            Exclude NA/null values when showing the result.
        *args, **kwargs
            Additional arguments and keywords for compatibility with NumPy.

        Returns
        -------
        scalar
            Minimum value.

        See Also
        --------
        Index.max : Return the maximum value of the object.
        Series.min : Return the minimum value in a Series.
        DataFrame.min : Return the minimum values in a DataFrame.

        Examples
        --------
        >>> idx = pd.Index([3, 2, 1])
        >>> idx.min()
        1

        >>> idx = pd.Index(['c', 'b', 'a'])
        >>> idx.min()
        'a'

        For a MultiIndex, the minimum is determined lexicographically.

        >>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
        >>> idx.min()
        ('a', 1)
        rrp�r�r�r�)r��validate_minr�r,r�r�rhrRr�r�r)rrrrr�rj�nanmin)r�r�r�rTrUrbr|s       r�rpz	Index.min�s���P	����f�%�
����%��4�y��>�>�!��t�9��5�5���G�E���;����~�~�$�,�,��;�;�D��T�X�X�Z��~�~�%��~�~�j����r�z�z�&J��<�<�'�'�U�6�'�B�B��}�}�T�\�\�&�9�9r�c�8�tj||�tj|�t|�s|jSt|�r|j
r|d}t
|�s|S|js6|jr*|j}|r|j�r|jS|jsAt|jtj�s|jjd|��St!j"|j|��S)a
        Return the maximum value of the Index.

        Parameters
        ----------
        axis : int, optional
            For compatibility with NumPy. Only 0 or None are allowed.
        skipna : bool, default True
            Exclude NA/null values when showing the result.
        *args, **kwargs
            Additional arguments and keywords for compatibility with NumPy.

        Returns
        -------
        scalar
            Maximum value.

        See Also
        --------
        Index.min : Return the minimum value in an Index.
        Series.max : Return the maximum value in a Series.
        DataFrame.max : Return the maximum values in a DataFrame.

        Examples
        --------
        >>> idx = pd.Index([3, 2, 1])
        >>> idx.max()
        3

        >>> idx = pd.Index(['c', 'b', 'a'])
        >>> idx.max()
        'c'

        For a MultiIndex, the maximum is determined lexicographically.

        >>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
        >>> idx.max()
        ('b', 2)
        r�r�r�r�)r��validate_maxr�r,r�r�rhrRr�r�r)rrrrr�rj�nanmax)r�r�r�rTrU�lastr|s       r�r�z	Index.max-s���R	����f�%�
����%��4�y��>�>�!��t�9��5�5���8�D���:����~�~�$�,�,��;�;�D��T�X�X�Z��~�~�%��~�~�j����r�z�z�&J��<�<�'�'�U�6�'�B�B��}�}�T�\�\�&�9�9r�c��t|�fS)z�
        Return a tuple of the shape of the underlying data.

        Examples
        --------
        >>> idx = pd.Index([1, 2, 3])
        >>> idx
        Index([1, 2, 3], dtype='int64')
        >>> idx.shape
        (3,)
        )r,r�s r�rzIndex.shapeos���D�	�|�r�)r�r,r�r�)r�r,r�z<tuple[ArrayLike, npt.NDArray[np.intp], npt.NDArray[np.intp]])r�r�)r�z5type[libindex.IndexEngine | libindex.ExtensionEngine])NNFNT)rr�r6r�r�r,)rr�)r�r$)NN)rNr r��Hashable | Noner�r,)r�z
type[Self])r��None)r�r�)r�r�r�r,)r�r,)r�zLlibindex.IndexEngine | libindex.ExtensionEngine | libindex.MaskedIndexEngine)r�z
set[str_t])r�r=)r�r�)r�znp.ufuncr��str_t)NF)r�r$)�C)r�r�r�r,r�)T)rTN)r�r"r�r�r�r,)r�r�r�r�)r�r�r�r,)r�r�r�r�r�r,)r�r�)r�z-list[tuple[str_t, str_t | int | bool | None]])r�zHashable | Sequence[Hashable])FNr)r�r�r�Callable | Nonerr�r��list[str_t])rr�rr�r�r�)rr�rr�r�r�)rr�r r�r�r�)r�r�r�r�)rr�r�r�r�r��r�r�)r5r�r�r�)NNF)r�r�r��list[Hashable])rz$Hashable | Sequence[Hashable] | Noner�r�)r�r~)r��Literal[False]r�r,)r��
Literal[True]r�r�)r�r�r�zSelf | None�F)NTNrb)rgzbool | list[bool]rhr*�r�r�)r)r�r')rsz	list[int])r��npt.NDArray[np.bool_])r�)r�rr�r,)r�r�r�r,)rdr#r�r,)rb)rdr#r�r�)r�r)r�r�r�r�r��tuple[Index, Index])r�r�r��bool | None)r�r�r�r�)r�r�)r�r�r�r�)r�zIndex | MultiIndexr�zArrayLike | MultiIndex)r�ztuple[Index, Hashable])NNN)r��ReindexMethod | Noner1�
int | Noner�r�)r<r�r��str_t | Noner1rr�r�)r<r�r�r�)r�rr1rr�r�)r<znp.ndarray | Indexr�r�)r<r�r�r�r1rr�r�)r<r�r1rr�r�)r<r�r�r�r�r�)r<r�r�r�r�r )r+r'r�r�)r+r'r zLiteral['loc', 'getitem'])r�zLiteral['slice', 'positional']r�z lib.NoDefault | None | Exceptionr�r�)r�r�r�r�)NNNN)r�rr1rr2zfloat | Noner�z)tuple[Index, npt.NDArray[np.intp] | None])r�r�)r<r�r�r�)r<r�r�z?tuple[Index, npt.NDArray[np.intp], npt.NDArray[np.intp] | None])r�r�r�r(r�r)r�r�r�r�r��Ftuple[Index, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None])r�r�r�r(r�r)r�r�r�r�r�r�)r�r�r�r(r�r)r�r�r�r�r��NIndex | tuple[Index, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None])r�r�r�r(r�zLevel | Noner�r�r�r�r�r)r�r�r�r(r�r�r�r)r�r�r�r()r�F)r�r�r�r(r�r�r�z8tuple[Index, npt.NDArray[np.intp], npt.NDArray[np.intp]])r�T)r�r�r�r(r�r�r�zKtuple[MultiIndex, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None])r�)r�r�r�r(r�r)
r�r r�r,r�r�r�r�r�r,)r�r )r�rs)r�r�)r9r�r�r )r�r�r�r=)r+rr�r�)r"r'r�r,)r�zIndex | Sequence[Index]r�r�)r'zlist[Index]r�r�r�r�)r�rr�r�)rjr�r|r�r�r�)
rfr�rgr�rhr*r+r�r�r,)
rfr�rgr�rhr*r+r�r�ztuple[Self, np.ndarray])
rfr�rgr�rhr*r+r�r�zSelf | tuple[Self, np.ndarray])FTr�N�r=N)rNr=)r�r�)r��1tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]])rZr�r�ztuple[Index, np.ndarray])rZr�r�r�).)r<r�r�r�r�r�)r<r�r�r�r�r)r<r�r�r�r�zHnpt.NDArray[np.intp] | tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]])r�r�r�r�)r�r�r�r�)r�r$r�r�)r�z PrettyDict[Hashable, np.ndarray])r{zLiteral['ignore'] | None)r+r�)rr�r�r�rxrr�r')r�zLiteral['positional', 'slice']r zLiteral['getitem', 'iloc']r�r�)rcr�)rc�Literal['left', 'right'])rcrr�r=)r�ztuple[int, int])r?r=r�r�)�raise)r�z'Index | np.ndarray | Iterable[Hashable]r�r&r�r�)rr�r�r�)r=)rNr=r�r�)r�r=r�r,)r�r�r�r�r�)r�r�r�r=)r�r�)r�r-( r��
__module__�__qualname__�__doc__�__pandas_priority__rr�r�r�r�r��__annotations__rrrsr�r�r�r�r�r�r3r�r��int8r��
Int8Engine�int16�Int16Engine�int32�Int32Engine�int64�Int64Engine�uint8�UInt8Engine�uint16�UInt16Engine�uint32�UInt32Enginerr�UInt64Enginer��
Float32Engine�float64�
Float64Enginer�r�r�r�r��propertyr��!_supports_partial_string_indexing�
_accessorsrlr�r�rr��classmethodr0r/r1rVrXr_r\rrqrtrvryrLr~r|r�r�rr�r�r�r�rr�r2r�r�r�r�rr�r�r�r�r�r�rrrrrrr&r,r.r0rrmr��setterr�r@rBrErrrJrVr4rkr]rardrkrmr�rtrrr�r�r�r�r�r[r�r�rIr�r�r�r�r�r�r�r�r�rRr�r�r�r�rh�isnullr��notnullr�r�r�r�r�r�r��__bool__r�r�r�r�r�r�r�r�r�rrrrrr�r�r)r�r;r7r4rHrIr[rJr\rfrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rNr5rwr-rr�r�r�rr	rjr$rrrrrrr$r�r&rxr�r6r:rArir�rPr�r*r�r�r	r\rXr8r�r5r:r�r�rurirr�r�r�r�r(r3rvr�rbr�r�r�r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�r)r�r�r>rpr�r�
__classcell__)r�s@r�r�r�@s����1�j���8��8��"��"�	E�"��"��"��"�	E�"��"��"��"�	E�"��"��D�#��&�&�
�
�
��W�I�S���C����E�8��#��d�"�%�h�L�)�&�$�X�K��%��0��0�	��������8�.�.���������H�0�0���������H�0�0���������H�0�0���������H�0�0���������X�2�2���������X�2�2���������X�2�2���������h�4�4���������h�4�4���������� 8� 8����������!:�!:�
R�M�N�
��I�	>�I��I�).�%���J�
��
�
.�C��K����
�"�
r��	r��
r�
�r�h����"��)���)�L�CG����&5��	
����0����"�����+��+�(�!.��!.�L6@�J�"������%)��%)�N�����%��%��.0�	U�.0��.0�`��

���

� �3�#+�J�
-��
-�� �� �����(!�F?�F 	����H� ��(�+<�<�=����D��D��	D�
�D�>�D�:����0#	����N� ��*�->�>�?�I�@�I�!%��(��(��(�
�	(�T�#��#��$��$��
.��
.������
��
�2�&�	9��	9��7��7��%)��	F��F�#�F��	F�

�F�<�O�
�
&*�	T��T�#�	T�

�T��T�,�0�����
��
��	
�
!�
�$!=�L�$�=C��=C�@!�3�>�>�;��;�(0�;�	�;�@����
�[�[�����27��+/��	����BKO�!�9�!�	�!�F(�+/��6
�*�:�6�E�
�(+�s�����(+�����(+�S����)-�e�g�R�8;��������$��V�V�$4�8��17��17�l���������.��'+��")�,
�%�,
�
 �,
�\%�N)��
�11��11�f�7��7�x�
������4��4�.�4��4�.�
�?���?� �
�?���?� � &�� &�D�
�!"���!"�F�)1��)1�V�)1��)1�V�1W��1W�f�1=��1=�f�.+��.+�`�25��25�h�'2��'2�R�B��B��
%��
%��;��;��
�
>���
>���/���/�1������
��
�����4�4��4�l�F�
�)��)�V�G��#�.�.�7�r�>"*�"*�H3:�12�12�f9+�|��
��
��H�
	���������$�w6��w6�rM�^�����S=��S=�j�<6���'��	����@�;;��;;�z	�6�O1�b����
"�)�V�(,� ��DC�%�DC��	DC�
�
DC��DC�R $� ��,��,��,��	,�
�
,�:�	��	��!��	+��+��+�

�+��+�Z�$�PT����%*��3=��	����@�@D����%*��3=��	����B����$.��	����>�<��<�&�<�

�<��<�����&:��	����(�?��?�R�h�
58�N�N�	�,��2�	�

����(�P��P�&(,�� �"&�
o�%�o�
�o� �
o�
3�o�b���E/��E/�	H�E/��E/�T�
���	��	��		�
�	�'�
	��	�
P�	��	��
��*-��	��	��		�
�	�(�
	��	�
�	��	��
�� #��	��	��		�
�	��
	��	�
X�	��	���
�"� %��d<��d<��	d<�
�d<��
d<��d<�
X�d<���d<�L�&��&�!(�&�04�&�	O�&��&�4� .�� .�!(� .�04� .�	O� .�� .�D�V��V�p�@E�/��/�!(�/�9=�/�	A�/��/�*�MQ�R7��R7�(/�R7�FJ�R7�	T�R7��R7�h�+1�2&��2&�!(�2&�	O�2&��2&�hV��V��V�#�	V�
#�V�
�
V�,��G���G�8�+��+�Z���	�	����������2 �D����&	�	��	$�	$�%��&���%*��%*�P��
���
��,+�'�X��
�E��E�2F�h
�����""-�H4�1*�fa=�F�
��
�@�I��I�V?��?�"7�?�	�?�B�*-��"%�"�
�'���	�
 ���
�
�����
�"%�"�
�&���	�
 ���
�
!����� #��"%�"�
����	�
 ���
�
(����$��V�H�=��
 %��"(�#�U ��U ��U � �	U �
�U �
(�
U ��U �n�Y��Y�;
�z%3�N)��	
��	
�,	�� ��`� �!9�:�=N�N�O�&J�	:�&J�P�&J�P����.�B!8�F�=@����-:��	����
����-;��	:����
�48����-1��	Q����
�48�%'��%'�-1�%'�	Q�%'��%'�N����V��
�+��+�Z����.�J��J�(
��"��"�4?V�D�.2�E��E�&G0�R"�"&�#��	43��43��43��	43�

�43�l�$��3�,�3�)�	3�

�3��3��@M�M�Q�fV&�V&�p&I�PI�\&�)$�7�)$��)$�
�	)$�V����>�5��5�8�C��C�8*�X�A��A��<��<�0��-��-�0�0�0�0�+�Z.�`�*��*��m�"�"�*�*�+�-�-�,�-�$�m�"�"�*�*�+�-�-�,�-�$=:�=:�~>:�>:�D�
�
���
r�c��ddlm}t|�dk(r|�|d}t|d|��S|j||��S)a�
    Construct an index from sequences of data.

    A single sequence returns an Index. Many sequences returns a
    MultiIndex.

    Parameters
    ----------
    sequences : sequence of sequences
    names : sequence of str

    Returns
    -------
    index : Index or MultiIndex

    Examples
    --------
    >>> ensure_index_from_sequences([[1, 2, 3]], names=["name"])
    Index([1, 2, 3], dtype='int64', name='name')

    >>> ensure_index_from_sequences([["a", "a"], ["a", "b"]], names=["L1", "L2"])
    MultiIndex([('a', 'a'),
                ('a', 'b')],
               names=['L1', 'L2'])

    See Also
    --------
    ensure_index
    rrr=rQr)r*r�r,r�r�)�	sequencesrr�s   r��ensure_index_from_sequencesr,�sH��<5�
�9�~������!�H�E��Y�q�\��.�.�%�z�%�%�i�u�=�=r�c���t|t�r|r|j�}|St|t�r|j}t|||��St|�rt
|�}t|t�rbt|�turt
|�}t|�r-tj|�rddlm}|j|�St||d��St||��S)ak
    Ensure that we have an index from some index-like object.

    Parameters
    ----------
    index_like : sequence
        An Index or other sequence
    copy : bool, default False

    Returns
    -------
    index : Index or MultiIndex

    See Also
    --------
    ensure_index_from_sequences

    Examples
    --------
    >>> ensure_index(['a', 'b'])
    Index(['a', 'b'], dtype='object')

    >>> ensure_index([('a', 'a'),  ('b', 'c')])
    Index([('a', 'a'), ('b', 'c')], dtype='object')

    >>> ensure_index([['a', 'a'], ['b', 'c']])
    MultiIndex([('a', 'b'),
            ('a', 'c')],
           )
    )r�rrrF)rr6r)rr�rrcr�rJr(rIr,r�is_all_arrayliker*r�r�)�
index_likerr�r�s    r�r�r��s���>�*�e�$��#���*�J����*�i�(������Z�d��6�6��:���*�%�
��*�d�#��
��4�'��j�)�J��z�?�s�3�3�J�?�<�)�:�)�)�*�5�5���$�e�D�D��Z�d�+�+r�c�R�	t|�|S#t$rt|�cYSwxYw)z<
    If seq is an iterator, put its values into a list.
    )r,r�r()�seqs r�r�r��s0����C���
�����C�y���s��&�&c��|s|St|�rBtd�|D��r0|D�cgc]}|dd��	}}t|�rtd�|D��r�0|Scc}w)z�
    Trims zeros and decimal points.

    Examples
    --------
    >>> trim_front([" a", " b"])
    ['a', 'b']

    >>> trim_front([" a", " "])
    ['a', '']
    c3�,K�|]}|ddk(���y�w)r� Nr�r�s  r�rztrim_front.<locals>.<genexpr>�s����<�G�q�q��t�s�{�G�s�r=N)r))�stringsr�s  r�rr�sZ�����

�g�,�3�<�G�<�<�")�*�'�Q�1�Q�R�5�'��*��g�,�3�<�G�<�<��N��+s�Ac�(�|dvrtd|����y)N)r�r�r�r�zdo not recognize join method r�r8s r�r�r�s#��
�8�8��8���A�B�B�9r�c��|�"t|ttf�r|j}t	|�st|j�d���|S)zR
    If no name is passed, then extract it from data, validating hashability.
    z.name must be a hashable type)rr�rcr�rHr�r�)r�r(r�s   r�rrsH���|�
�3��	�(:�;��x�x���t���3�<�<�.�(E�F�G�G��Kr�c��|D�cgc]}t|j���}}t|�D�cgc]}h|���}}td�|D��}|Scc}wcc}w)z�
    Return common name if all indices agree, otherwise None (level-by-level).

    Parameters
    ----------
    indexes : list of Index objects

    Returns
    -------
    list
        A list representing the unanimous 'names' found.
    c3�\K�|]$}t|�dk(r|j�nd���&y�wr)r,r�)r
�nss  r�rz&get_unanimous_names.<locals>.<genexpr>'s&����I�y��c�"�g��l�"�&�&�(��4�y�s�*,)r	rr)�indexesrQ�	name_tupsr:�	name_setsrs      r��get_unanimous_namesr>s\��*1�1��A��q�w�w���I�1�!,�i�!8�9�!8�2��2��!8�I�9��I�y�I�I�E��L��2��9s
�A�Ac�R�|j}t|t�r|jjSt|t�rZddl}|jj|j�r1|ddjt	|jj��}|jS)z�
    When checking if our dtype is comparable with another, we need
    to unpack CategoricalDtype to look at its categories.dtype.

    Parameters
    ----------
    other : Index

    Returns
    -------
    np.dtype or ExtensionDtype
    rN)r�rrVr�rUr�r��
is_dictionary�
pyarrow_dtyper�
value_type)r�r�r�s   r�r�r�+s���
�K�K�E��%�)�*����%�%�%�	�E�:�	&��
�8�8�!�!�%�"5�"5�6��"�1�I�$�$�Z��0C�0C�0N�0N�%O�P�E��;�;�r�c���|dur	tj|�}|S|S#t$r7}|dur�tj|�d�t
t
���Yd}~|Sd}~wwxYw)NFTz3, sort order is undefined for incomparable objects.r)r�	safe_sortr�r3r4�RuntimeWarningr6)r9r�r;s   r�r�r�Fsr���5��	��_�_�V�,�F��M�6�M���	��t�|���M�M��%�J�K��+�-�
�
�
�M��	�s��	A�,A�Aryr)rr#r!r c���t|t�ra|jjjdvr?tj|jjt|j�|��}t|�}t|ttf�r�|jdk(r,|j||��}|jt d��}|Sg}t#t%|��D]B}||dd�fj||��}|j'|jt d����Dt)j*|�St|jt,�r!t/d|�}|j||��}	|	St|jt0�rjt/d	|�}|j3�}
|s)t)j4|�jt6�}nt)j8|t d
��}|||
<|S|jjdk(r�t|jt:�s�|�]|d
k(rXt3|�}
|s|jt6�}nt)j8|d��}|||
<|jt d��}|Sddlm}||||||d��}|jA�}	|	jt d��}	|	St|tB�r:t3|�}
t)j4|jt ��}
||
|
<|
St3|�}
tEjF|�}|jtHk7rg|se|rc|jt6�}|jjJt)jd�jJz|kr,|jd|���}nt)j8|d��}|||
<|jt d��}|S)zd
    Convert to types which can be consumed by the standard library's
    csv.writer.writerows.
    r�r/r=)rr"FrNr�r�Trr|rr�rr)�FloatArrayFormatter)rr!r r#�fixed_width�U1z<U)&rrqr�r�r rr9rrC�_codesryrrrtr>�_format_native_typesrr�rr,r�r�vstackrZr
rYrhr&r�r-r[rrG�get_result_as_arrayrsr�word_lenr#�itemsize)rNr"rr#r!r r9�results_convertedrQrr|rGrr�rOs               r�r%r%Zs@���&�+�&�6�+<�+<�+B�+B�+G�+G�4�+O�������%�%���
�
�.��
��,�F�
3�F��&�=�.�9�:��;�;�!���0�0��K�0�X�F��]�]�6��]�6�F��M����s�6�{�#�A��A�q�D�\�6�6��;�7��F�
�$�$�V�]�]�6��]�%F�G�	$�
�y�y�*�+�+�	�F�L�L�+�	.��m�V�,���)�)��[�)�Q���
�	�F�L�L�-�	0��o�v�.���{�{�}����Z�Z��'�.�.�s�3�F��X�X�f�F��>�F���t���
�	���	�	�c�	!�*�V�\�\�;�*O���G�s�N���<�D�����s�+�����&��9��!�F�4�L��]�]�6��]�6�F��M�@�'���%����

�	��+�+�-���j�j��e�j�,���
�	�F�N�	+��F�|���Z�Z��
�
�f� 5�6�
�!�
�4�����F�|���#�#�F�+���<�<�:�%�g�(��]�]�3�'�F��|�|�$�$�r�x�x��~�'>�'>�>��I�����H�:��7���X�X�f�H�5�F���t�����v�E��2���
r�)r�r%r�r%r�r�r�)r/r!rr�r�r�)r5r�r�r�)r�r�r�r�r�)r;r�r�ztuple[Hashable, ...])r�r�r�r$)r9zIndex | ArrayLiker�r)rNr rr�r r�r�r�)��
__future__r�collectionsrrr��	itertoolsrrg�typingrrr	r
rrr
rrr3�numpyr�pandas._configrrr�pandas._libsrrrZrr�rr�pandas._libs.internalsr�pandas._libs.join�_libsr�r��pandas._libs.librr�pandas._libs.tslibsrrrr�pandas._typingrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.�pandas.compat.numpyr/r��
pandas.errorsr0r1�pandas.util._decoratorsr2r3r4r5�pandas.util._exceptionsr6r7�pandas.core.dtypes.astyper8r9�pandas.core.dtypes.castr:r;r<r=r>r?r@�pandas.core.dtypes.commonrArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrS�pandas.core.dtypes.concatrT�pandas.core.dtypes.dtypesrUrVrWrXrYrZr[�pandas.core.dtypes.genericr\r]r^r_r`rarbrcrd�pandas.core.dtypes.inferencere�pandas.core.dtypes.missingrfrgrh�pandas.corerirjrk�pandas.core.accessorrl�pandas.core.algorithms�core�
algorithms�pandas.core.array_algos.putmaskrmrn�pandas.core.arraysrorprqrrrsrt�pandas.core.arrays.string_rurv�pandas.core.baserwrx�pandas.core.common�commonr!�pandas.core.constructionryrzr{�pandas.core.indexersr|r}�pandas.core.indexes.frozenr~�pandas.core.missingr�pandas.core.opsr��pandas.core.ops.invalidr��pandas.core.sortingr�r�r��pandas.core.strings.accessorr��pandas.io.formats.printingr�r�r�r��collections.abcr�r�r�rHr�r�r�r�r�r��__all__�	frozenset�_unsortable_typesr�rr�r�r�r�r#�MaskedComplex128Engine�MaskedComplex64Engine�MaskedFloat64Engine�MaskedFloat32Engine�MaskedUInt64Engine�MaskedUInt32Engine�MaskedUInt16Engine�MaskedUInt8Engine�MaskedInt64Engine�MaskedInt32Engine�MaskedInt16Engine�MaskedInt8Engine�MaskedBoolEnginer�r�r�r�r,r�r�rr�rr>r�r�r%r�r�r��<module>r�s���"����!��
�
�
�������3�#�#���������$/�����
����������*4����
�
�
�6�����
0�&�&������!� ���
�2�9�.�3���
7���������
�)���8�9��������
%��>��&(��N�'���
�R�X�X�h�
�
���(�1�1����/�/���x�+�+���x�+�+�	�

�h�)�)��
�h�)�)�
�
�h�)�)���X�
'�
'���X�
'�
'���X�
'�
'���X�
'�
'���H�%�%���x�(�(���x�3�3����4�4�� ��4�4�!�"�h�2�2�#�$ �2�2��2�2��2�2��0�0��0�0��0�0��0�0��.�.��.�.�5��<�8!�8~p�M�<�~p�Bb%>�P8,�v	��&C�

� �&�6�0����k��k�
�	k��k��kr�

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