
    Egz                     T    d dl Zd dlZd dlmZmZmZmZ d dlm	Z
  G d d          ZdS )    N)CategoricalCategoricalIndexIndexIntervalc                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	TestReindexc                     d}t          g d          }t          j        t          |          5  |                    ddg           d d d            d S # 1 swxY w Y   d S N/cannot reindex on an axis with duplicate labelsabcr   matchr   r   r   pytestraises
ValueErrorreindexselfmsgcis      b/var/www/sysmax/venv/lib/python3.11/site-packages/pandas/tests/indexes/categorical/test_reindex.pytest_reindex_list_non_uniquez(TestReindex.test_reindex_list_non_unique   s    ?22233]:S111 	# 	#JJSz"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   AAAc                     d}t          g d          }t          j        t          |          5  |                    t          ddg                     d d d            d S # 1 swxY w Y   d S r
   r   r   r   r   r   r   r   s      r   #test_reindex_categorical_non_uniquez/TestReindex.test_reindex_categorical_non_unique   s    ?22233]:S111 	0 	0JJ{C:..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   %A!!A%(A%c                     d}t          g dg d          }t          j        t          |          5  |                    ddg           d d d            d S # 1 swxY w Y   d S Nr   r   r   r   r   d
categoriesr   r   r   r   r   s      r   ,test_reindex_list_non_unique_unused_categoryz8TestReindex.test_reindex_list_non_unique_unused_category   s    ?222?S?S?STTT]:S111 	# 	#JJSz"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   AAAc                     d}t          g dg d          }t          j        t          |          5  |                    t          ddg                     d d d            d S # 1 swxY w Y   d S r!   r   r   s      r   3test_reindex_categorical_non_unique_unused_categoryz?TestReindex.test_reindex_categorical_non_unique_unused_category!   s    ?222?S?S?STTT]:S111 	0 	0JJ{C:..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   %A%%A),A)c                 6   t          g dg d          }|                    g d          \  }}t          g d          }t          j        ||d           t          j        |t          j        g dt          j                             |                    t          g dg d                    \  }}t          g dg d          }t          j        ||d           t          j        |t          j        g dt          j                             d S )	N)r   r   r   r"   r$   )r   r   r   Texact)r      r,   dtype)	r   r   r   tmassert_index_equalassert_numpy_array_equalnparrayintp)r   catresindexerexps        r   test_reindex_duplicate_targetz)TestReindex.test_reindex_duplicate_target'   s    ;O;O;OPPP{{???33WOOO$$
c3d3333
#GRXiiirw-O-O-OPPP{{___9M9M9MNNN
 
W ;O;O;OPPP
c3d3333
#GRXiiirw-O-O-OPPPPP    c                    t          g           }|                    ddg          \  }}t          j        |t	          ddg          d           t          j        |t          j        ddgt          j                             d S )Nr   r   Tr*   r-   )	r   r   r/   r0   r   r1   r2   r3   r4   )r   r   r6   r7   s       r   test_reindex_empty_indexz$TestReindex.test_reindex_empty_index6   sz    R  yy#s,,W
c5#s#4#4DAAAA
#GRXr2hbg-N-N-NOOOOOr:   c           
      t   t          t          ddd          t          ddd          gd          }t          t          ddd          t          ddd          t          ddd          t          dd	d          gd          }|                    |          \  }}|}t          j        ||           d S )
Nr      right)closedr,   T)ordered      )r   r   r   r/   r0   )r   r   ci_addresult_expecteds         r   'test_reindex_categorical_added_categoryz3TestReindex.test_reindex_categorical_added_category=   s    a7+++Xa7-K-K-KL
 
 
 "Ag...Ag...Ag...Ag...	 
 
 
 JJv&&	
h/////r:   N)
__name__
__module____qualname__r   r   r&   r(   r9   r=   rI    r:   r   r   r      s        # # #0 0 0# # #0 0 0Q Q QP P P0 0 0 0 0r:   r   )numpyr2   r   pandasr   r   r   r   pandas._testing_testingr/   r   rM   r:   r   <module>rR      s                         A0 A0 A0 A0 A0 A0 A0 A0 A0 A0r:   