o
    7?e                     @   sF   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 dZdS )    N)CategoricalCategoricalIndexIndexIntervalc                   @   sD   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dS )TestReindexc                 C   sR   d}t g d}tjt|d |ddg W d    d S 1 s"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ci r   n/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/pandas/tests/indexes/categorical/test_reindex.pytest_reindex_list_non_unique   s
   "z(TestReindex.test_reindex_list_non_uniquec                 C   sV   d}t g d}tjt|d |tddg W d    d S 1 s$w   Y  d S r   r   r   r   r   r   r   r   r   r   r   #test_reindex_categorical_non_unique   s
   "z/TestReindex.test_reindex_categorical_non_uniquec                 C   sZ   d}t g dg dd}tjt|d |ddg W d    d S 1 s&w   Y  d S Nr   r	   r
   r   r   d
categoriesr   r
   r   r   r   r   r   r   ,test_reindex_list_non_unique_unused_category   s
   "z8TestReindex.test_reindex_list_non_unique_unused_categoryc                 C   s^   d}t g dg dd}tjt|d |tddg W d    d S 1 s(w   Y  d S r   r   r   r   r   r   3test_reindex_categorical_non_unique_unused_category!   s
   "z?TestReindex.test_reindex_categorical_non_unique_unused_categoryc                 C   s   t g dg dd}|g d\}}tg ddd}tj||dd t|tjg d	tjd |t g dg dd\}}t g dg dd}tj||dd t|tjg d	tjd d S )
N)r
   r   r   r   r    )r
   r   r   objectZdtypeTexact)r      r(   )	r   r   r   tmassert_index_equalassert_numpy_array_equalnparrayintp)r   catresindexerexpr   r   r   test_reindex_duplicate_target'   s    z)TestReindex.test_reindex_duplicate_targetc                 C   sR   t g }|ddg\}}tj|tddgdd t|tjddgtjd d S )Nr
   r   Tr&   r%   )	r   r   r)   r*   r   r+   r,   r-   r.   )r   r   r0   r1   r   r   r   test_reindex_empty_index6   s    z$TestReindex.test_reindex_empty_indexc              	   C   s   t tddddtddddgdd}t tddddtddddtddddtdd	ddgdd}||\}}|}t|| d S )
Nr      right)closedr(   T)Zordered      )r   r   r   r)   r*   )r   r   Zci_addresult_expectedr   r   r   'test_reindex_categorical_added_category=   s   	z3TestReindex.test_reindex_categorical_added_categoryN)
__name__
__module____qualname__r   r   r"   r#   r3   r5   r>   r   r   r   r   r      s    r   )numpyr,   r   Zpandasr   r   r   r   Zpandas._testingZ_testingr)   r   r   r   r   r   <module>   s
    