1
2
3
4
5
6
7
8
9
10
11
12
13
14
U
­ý°dØ ã@sFddlZddlZddlmZmZmZmZddlm    Z
Gdd„dƒZ dS)éN)Ú CategoricalÚCategoricalIndexÚIndexÚIntervalc@sDeZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dS)Ú TestReindexc    Cs@d}tddddgƒ}tjt|d| ddg¡W5QRXdS©Nú/cannot reindex on an axis with duplicate labelsÚaÚbÚc©Úmatch©rÚpytestÚraisesÚ
ValueErrorÚreindex©ÚselfÚmsgÚci©rúdd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/indexes/categorical/test_reindex.pyÚtest_reindex_list_non_uniquesz(TestReindex.test_reindex_list_non_uniquec    CsDd}tddddgƒ}tjt|d| tddgƒ¡W5QRXdSr©rrrrrrrrrrÚ#test_reindex_categorical_non_uniquesz/TestReindex.test_reindex_categorical_non_uniquec    CsLd}tddddgddddgd}tjt|d| ddg¡W5QRXdS©Nrr    r
r Úd©Ú
categoriesr rrrrrÚ,test_reindex_list_non_unique_unused_categorysz8TestReindex.test_reindex_list_non_unique_unused_categoryc    CsPd}tddddgddddgd}tjt|d| tddgƒ¡W5QRXdSrrrrrrÚ3test_reindex_categorical_non_unique_unused_category!sz?TestReindex.test_reindex_categorical_non_unique_unused_categorycCsÞtdddgddddgd}| dddg¡\}}tdddgdd}tj||dd    t |tjd
d d gtjd¡| tdddgddddgd¡\}}tdddgddddgd}tj||dd    t |tjd
d d gtjd¡dS) Nr    r
r rrÚobject©ZdtypeT©Úexactré)    rrrÚtmÚassert_index_equalÚassert_numpy_array_equalÚnpÚarrayÚintp)rÚcatÚresÚindexerÚexprrrÚtest_reindex_duplicate_target'sÿz)TestReindex.test_reindex_duplicate_targetcCsRtgƒ}| ddg¡\}}tj|tddgƒddt |tjddgtjd¡dS)Nr    r
Tr$éÿÿÿÿr#)    rrr'r(rr)r*r+r,)rr r.r/rrrÚtest_reindex_empty_index6sz$TestReindex.test_reindex_empty_indexc    Cs‚ttddddtddddgdd}ttddddtddddtddddtdd    ddgdd}| |¡\}}|}t ||¡dS)
NréÚright)Úclosedr&T)Zorderedéé)rrrr'r()rrZci_addÚresultÚ_ÚexpectedrrrÚ'test_reindex_categorical_added_category=sþ    üù    z3TestReindex.test_reindex_categorical_added_categoryN)
Ú__name__Ú
__module__Ú __qualname__rrr r!r1r3r<rrrrr sr) Únumpyr*rZpandasrrrrZpandas._testingZ_testingr'rrrrrÚ<module>s