o
    ôT·j8i  ã                   @   sh   d dl Zd dlZd dlmZ d dlmZmZmZm	Z	m
Z
mZmZmZmZ G dd„ dƒZG dd„ dƒZdS )é    N)Úusing_string_dtype)	ÚCategoricalÚCategoricalDtypeÚCategoricalIndexÚIndexÚSeriesÚ
date_rangeÚoption_contextÚperiod_rangeÚtimedelta_rangec                   @   s   e Zd Zdd„ ZdS )ÚTestCategoricalReprWithFactorc                 C   sN   t g d¢dd�}|rdnd}dd|› d�g}d	 |¡}t|ƒ}||ks%J ‚d S )
N)ÚaÚbr   r   r   Úcr   r   T©ÚorderedÚstrÚobjectz(['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c']zCategories (3, z): ['a' < 'b' < 'c']Ú
)r   ÚjoinÚrepr)ÚselfÚusing_infer_stringÚfactorÚdtypeÚexpectedÚactual© r   úl/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/pandas/tests/arrays/categorical/test_repr.pyÚ
test_print   s   
þ
z(TestCategoricalReprWithFactor.test_printN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   c                   @   sÎ   e Zd Zdd„ Zdd„ Zdd„ Zejje	ƒ dd�d	d
„ ƒZ
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd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 )0ÚTestCategoricalReprc                 C   s`   t  g d¢d ¡}ttg d¢td�d�}tj||d�}g d¢}d |¡}t|ƒ}||ks.J ‚d S )N)r   é   é   r   r$   r%   éd   ©r   r   r   ©r   ©Ú
categories)z7['a', 'b', 'c', 'a', 'b', ..., 'b', 'c', 'a', 'b', 'c']zLength: 600z'Categories (3, object): ['a', 'b', 'c']r   )	ÚnpÚarrayr   r   r   r   Ú
from_codesr   r   )r   Úcodesr   r   r   r   r   r   r   Útest_big_print!   s   
z"TestCategoricalRepr.test_big_printc                 C   sŽ   t g tg d¢td�ƒ}d}t|ƒ}||ksJ ‚||ksJ ‚t g tg d¢td�dd�}d}t|ƒ}||ks6J ‚t g g ƒ}d}|t|ƒksEJ ‚d S )Nr'   r(   z+[], Categories (3, object): ['a', 'b', 'c']Tr   z-[], Categories (3, object): ['a' < 'b' < 'c']z[], Categories (0, object): [])r   r   r   r   )r   r   r   r   r   r   r   Útest_empty_print0   s   
z$TestCategoricalRepr.test_empty_printc                 C   sT   t tg d¢ƒƒ}d}tdd ƒ� |t|ƒksJ ‚W d   ƒ d S 1 s#w   Y  d S )N)r$   r%   é   é   zO0    1
1    2
2    3
3    4
dtype: category
Categories (4, int64): [1, 2, 3, 4]zdisplay.width)r   r   r	   r   )r   r   Úexpr   r   r   Útest_print_none_width@   s   ÿ"ÿz)TestCategoricalRepr.test_print_none_widthz2Change once infer_string is set to True by default)Úreasonc                 C   sœ   t g d¢d ƒ}d}t|ƒ|ksJ ‚t g d¢d ƒ}d}t|ƒ|ks$J ‚tddƒ� t g d¢d ƒ}d}t|ƒ|ks<J ‚W d   ƒ d S 1 sGw   Y  d S )N)ÚaaaaaÚbbÚccccé   z‹['aaaaa', 'bb', 'cccc', 'aaaaa', 'bb', ..., 'bb', 'cccc', 'aaaaa', 'bb', 'cccc']
Length: 60
Categories (3, object): ['aaaaa', 'bb', 'cccc'])u   ã�‚ã�‚ã�‚ã�‚u   ã�„ã�„ã�„ã�„ã�„u   ã�†ã�†ã�†ã�†ã�†ã�†ã�†u,  ['ã�‚ã�‚ã�‚ã�‚', 'ã�„ã�„ã�„ã�„ã�„', 'ã�†ã�†ã�†ã�†ã�†ã�†ã�†', 'ã�‚ã�‚ã�‚ã�‚', 'ã�„ã�„ã�„ã�„ã�„', ..., 'ã�„ã�„ã�„ã�„ã�„', 'ã�†ã�†ã�†ã�†ã�†ã�†ã�†', 'ã�‚ã�‚ã�‚ã�‚', 'ã�„ã�„ã�„ã�„ã�„', 'ã�†ã�†ã�†ã�†ã�†ã�†ã�†']
Length: 60
Categories (3, object): ['ã�‚ã�‚ã�‚ã�‚', 'ã�„ã�„ã�„ã�„ã�„', 'ã�†ã�†ã�†ã�†ã�†ã�†ã�†']z display.unicode.east_asian_widthT)r   r   r	   )r   r   r   r   r   r   Útest_unicode_printK   s   "úz&TestCategoricalRepr.test_unicode_printc                 C   s˜   t g d¢ƒ}d}t|ƒ|ksJ ‚t g d¢g d¢d�}d}t|ƒ|ks$J ‚t g d¢d ƒ}d}t|ƒ|ks6J ‚t tjd	tjd
�ƒ}d}t|ƒ|ksJJ ‚d S )N©r$   r%   r1   z*[1, 2, 3]
Categories (3, int64): [1, 2, 3]©r$   r%   r1   r$   r%   r1   r)   z3[1, 2, 3, 1, 2, 3]
Categories (3, int64): [1, 2, 3]©r$   r%   r1   r2   é   é
   zU[1, 2, 3, 4, 5, ..., 1, 2, 3, 4, 5]
Length: 50
Categories (5, int64): [1, 2, 3, 4, 5]r9   r(   zm[0, 1, 2, 3, 4, ..., 15, 16, 17, 18, 19]
Length: 20
Categories (20, int64): [0, 1, 2, 3, ..., 16, 17, 18, 19]©r   r   r+   ÚarangeÚint64©r   r   r3   r   r   r   Útest_categorical_reprj   s   z)TestCategoricalRepr.test_categorical_reprc                 C   s¦   t g d¢dd�}d}t|ƒ|ksJ ‚t g d¢g d¢dd�}d}t|ƒ|ks'J ‚t g d¢d	 dd�}d
}t|ƒ|ks;J ‚t tjdtjd�dd�}d}t|ƒ|ksQJ ‚d S )Nr;   Tr   z,[1, 2, 3]
Categories (3, int64): [1 < 2 < 3]r<   ©r*   r   z5[1, 2, 3, 1, 2, 3]
Categories (3, int64): [1 < 2 < 3]r=   r?   zY[1, 2, 3, 4, 5, ..., 1, 2, 3, 4, 5]
Length: 50
Categories (5, int64): [1 < 2 < 3 < 4 < 5]r9   r(   zq[0, 1, 2, 3, 4, ..., 15, 16, 17, 18, 19]
Length: 20
Categories (20, int64): [0 < 1 < 2 < 3 ... 16 < 17 < 18 < 19]r@   rC   r   r   r   Útest_categorical_repr_ordered…   s   z1TestCategoricalRepr.test_categorical_repr_orderedc                 C   s¦   t dddd�}t|ƒ}d}t|ƒ|ksJ ‚t| |¡|d�}d}t|ƒ|ks(J ‚t ddddd	�}t|ƒ}d
}t|ƒ|ks>J ‚t| |¡|d�}d}t|ƒ|ksQJ ‚d S )Nú2011-01-01 09:00Úhr>   ©ÚfreqÚperiodsa  [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00]
Categories (5, datetime64[ns]): [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00,
                                 2011-01-01 12:00:00, 2011-01-01 13:00:00]r)   a}  [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00, 2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00]
Categories (5, datetime64[ns]): [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00,
                                 2011-01-01 12:00:00, 2011-01-01 13:00:00]ú
US/Eastern©rJ   rK   Útza•  [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00]
Categories (5, datetime64[ns, US/Eastern]): [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,
                                             2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,
                                             2011-01-01 13:00:00-05:00]a  [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00, 2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00]
Categories (5, datetime64[ns, US/Eastern]): [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,
                                             2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,
                                             2011-01-01 13:00:00-05:00]©r   r   r   Úappend©r   Úidxr   r3   r   r   r   Útest_categorical_repr_datetime    s$   ÿ	ÿÿÿz2TestCategoricalRepr.test_categorical_repr_datetimec                 C   s²   t dddd�}t|dd�}d}t|ƒ|ksJ ‚t| |¡|dd�}d	}t|ƒ|ks+J ‚t dddd
d�}t|dd�}d}t|ƒ|ksCJ ‚t| |¡|dd�}d}t|ƒ|ksWJ ‚d S )NrG   rH   r>   rI   Tr   a  [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00]
Categories (5, datetime64[ns]): [2011-01-01 09:00:00 < 2011-01-01 10:00:00 < 2011-01-01 11:00:00 <
                                 2011-01-01 12:00:00 < 2011-01-01 13:00:00]rE   a�  [2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00, 2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00]
Categories (5, datetime64[ns]): [2011-01-01 09:00:00 < 2011-01-01 10:00:00 < 2011-01-01 11:00:00 <
                                 2011-01-01 12:00:00 < 2011-01-01 13:00:00]rL   rM   a™  [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00]
Categories (5, datetime64[ns, US/Eastern]): [2011-01-01 09:00:00-05:00 < 2011-01-01 10:00:00-05:00 <
                                             2011-01-01 11:00:00-05:00 < 2011-01-01 12:00:00-05:00 <
                                             2011-01-01 13:00:00-05:00]a   [2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00, 2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00]
Categories (5, datetime64[ns, US/Eastern]): [2011-01-01 09:00:00-05:00 < 2011-01-01 10:00:00-05:00 <
                                             2011-01-01 11:00:00-05:00 < 2011-01-01 12:00:00-05:00 <
                                             2011-01-01 13:00:00-05:00]rO   rQ   r   r   r   Ú&test_categorical_repr_datetime_orderedÞ   s   z:TestCategoricalRepr.test_categorical_repr_datetime_orderedc                 C   sV   t ddtjgƒ}d}t|ƒ|ksJ ‚tddtjgdd� d¡}d}t|ƒ|ks)J ‚d S )Nr$   r%   z)[1, 2, NaN]
Categories (2, int64): [1, 2]r   r(   ÚcategoryzH0      1
1      2
2    NaN
dtype: category
Categories (2, int64): [1, 2])r   r+   Únanr   r   Úastype)r   r   Úc_expÚsÚs_expr   r   r   Ú"test_categorical_repr_int_with_nanÿ   s   z6TestCategoricalRepr.test_categorical_repr_int_with_nanc                 C   s¤   t dddd�}t|ƒ}d}t|ƒ|ksJ ‚t| |¡|d�}d}t|ƒ|ks(J ‚t dd	dd�}t|ƒ}d
}t|ƒ|ks=J ‚t| |¡|d�}d}t|ƒ|ksPJ ‚d S )NrG   rH   r>   rI   zì[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
Categories (5, period[h]): [2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00,
                            2011-01-01 13:00]r)   aF  [2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00, 2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
Categories (5, period[h]): [2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00,
                            2011-01-01 13:00]ú2011-01ÚMzv[2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
Categories (5, period[M]): [2011-01, 2011-02, 2011-03, 2011-04, 2011-05]z£[2011-01, 2011-02, 2011-03, 2011-04, 2011-05, 2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
Categories (5, period[M]): [2011-01, 2011-02, 2011-03, 2011-04, 2011-05]©r
   r   r   rP   rQ   r   r   r   Útest_categorical_repr_period
  s   z0TestCategoricalRepr.test_categorical_repr_periodc                 C   s°   t dddd�}t|dd�}d}t|ƒ|ksJ ‚t| |¡|dd�}d	}t|ƒ|ks+J ‚t d
ddd�}t|dd�}d}t|ƒ|ksBJ ‚t| |¡|dd�}d}t|ƒ|ksVJ ‚d S )NrG   rH   r>   rI   Tr   zð[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
Categories (5, period[h]): [2011-01-01 09:00 < 2011-01-01 10:00 < 2011-01-01 11:00 < 2011-01-01 12:00 <
                            2011-01-01 13:00]rE   aJ  [2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00, 2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
Categories (5, period[h]): [2011-01-01 09:00 < 2011-01-01 10:00 < 2011-01-01 11:00 < 2011-01-01 12:00 <
                            2011-01-01 13:00]r\   r]   zz[2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
Categories (5, period[M]): [2011-01 < 2011-02 < 2011-03 < 2011-04 < 2011-05]z§[2011-01, 2011-02, 2011-03, 2011-04, 2011-05, 2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
Categories (5, period[M]): [2011-01 < 2011-02 < 2011-03 < 2011-04 < 2011-05]r^   rQ   r   r   r   Ú$test_categorical_repr_period_ordered'  s   z8TestCategoricalRepr.test_categorical_repr_period_orderedc                 C   s    t ddd�}t|ƒ}d}t|ƒ|ksJ ‚t| |¡|d�}d}t|ƒ|ks'J ‚t ddd�}t|ƒ}d	}t|ƒ|ks;J ‚t| |¡|d�}d
}t|ƒ|ksNJ ‚d S )Nú1 daysr>   ©rK   zr[1 days, 2 days, 3 days, 4 days, 5 days]
Categories (5, timedelta64[ns]): [1 days, 2 days, 3 days, 4 days, 5 days]r)   zš[1 days, 2 days, 3 days, 4 days, 5 days, 1 days, 2 days, 3 days, 4 days, 5 days]
Categories (5, timedelta64[ns]): [1 days, 2 days, 3 days, 4 days, 5 days]ú1 hoursr9   a¹  [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, 4 days 01:00:00, ..., 15 days 01:00:00, 16 days 01:00:00, 17 days 01:00:00, 18 days 01:00:00, 19 days 01:00:00]
Length: 20
Categories (20, timedelta64[ns]): [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00,
                                   3 days 01:00:00, ..., 16 days 01:00:00, 17 days 01:00:00,
                                   18 days 01:00:00, 19 days 01:00:00]a¹  [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, 4 days 01:00:00, ..., 15 days 01:00:00, 16 days 01:00:00, 17 days 01:00:00, 18 days 01:00:00, 19 days 01:00:00]
Length: 40
Categories (20, timedelta64[ns]): [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00,
                                   3 days 01:00:00, ..., 16 days 01:00:00, 17 days 01:00:00,
                                   18 days 01:00:00, 19 days 01:00:00]©r   r   r   rP   rQ   r   r   r   Útest_categorical_repr_timedeltaD  s   z3TestCategoricalRepr.test_categorical_repr_timedeltac                 C   s¬   t ddd�}t|dd�}d}t|ƒ|ksJ ‚t| |¡|dd�}d}t|ƒ|ks*J ‚t d	d
d�}t|dd�}d}t|ƒ|ks@J ‚t| |¡|dd�}d}t|ƒ|ksTJ ‚d S )Nra   r>   rb   Tr   zv[1 days, 2 days, 3 days, 4 days, 5 days]
Categories (5, timedelta64[ns]): [1 days < 2 days < 3 days < 4 days < 5 days]rE   zž[1 days, 2 days, 3 days, 4 days, 5 days, 1 days, 2 days, 3 days, 4 days, 5 days]
Categories (5, timedelta64[ns]): [1 days < 2 days < 3 days < 4 days < 5 days]rc   r9   a½  [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, 4 days 01:00:00, ..., 15 days 01:00:00, 16 days 01:00:00, 17 days 01:00:00, 18 days 01:00:00, 19 days 01:00:00]
Length: 20
Categories (20, timedelta64[ns]): [0 days 01:00:00 < 1 days 01:00:00 < 2 days 01:00:00 <
                                   3 days 01:00:00 ... 16 days 01:00:00 < 17 days 01:00:00 <
                                   18 days 01:00:00 < 19 days 01:00:00]a½  [0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, 4 days 01:00:00, ..., 15 days 01:00:00, 16 days 01:00:00, 17 days 01:00:00, 18 days 01:00:00, 19 days 01:00:00]
Length: 40
Categories (20, timedelta64[ns]): [0 days 01:00:00 < 1 days 01:00:00 < 2 days 01:00:00 <
                                   3 days 01:00:00 ... 16 days 01:00:00 < 17 days 01:00:00 <
                                   18 days 01:00:00 < 19 days 01:00:00]rd   rQ   r   r   r   Ú'test_categorical_repr_timedelta_orderede  s   z;TestCategoricalRepr.test_categorical_repr_timedelta_orderedc                 C   sT   t tg d¢ƒƒ}d}t|ƒ|ksJ ‚t ttjdtjd�ƒƒ}d}t|ƒ|ks(J ‚d S )Nr;   zRCategoricalIndex([1, 2, 3], categories=[1, 2, 3], ordered=False, dtype='category')r?   r(   z{CategoricalIndex([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], categories=[0, 1, 2, 3, ..., 6, 7, 8, 9], ordered=False, dtype='category')©r   r   r   r+   rA   rB   )r   rR   r3   Úir   r   r   Útest_categorical_index_repr†  s   z/TestCategoricalRepr.test_categorical_index_reprc                 C   s\   t tg d¢dd�ƒ}d}t|ƒ|ksJ ‚t ttjdtjd�dd�ƒ}d}t|ƒ|ks,J ‚d S )Nr;   Tr   zQCategoricalIndex([1, 2, 3], categories=[1, 2, 3], ordered=True, dtype='category')r?   r(   zzCategoricalIndex([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], categories=[0, 1, 2, 3, ..., 6, 7, 8, 9], ordered=True, dtype='category')rg   )r   rh   r3   r   r   r   Ú#test_categorical_index_repr_ordered�  s   z7TestCategoricalRepr.test_categorical_index_repr_orderedc                 C   sb   t dddd�}tt|ƒƒ}d}t|ƒ|ksJ ‚t ddddd�}tt|ƒƒ}d}t|ƒ|ks/J ‚d S )	NrG   rH   r>   rI   aQ  CategoricalIndex(['2011-01-01 09:00:00', '2011-01-01 10:00:00',
                  '2011-01-01 11:00:00', '2011-01-01 12:00:00',
                  '2011-01-01 13:00:00'],
                 categories=[2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00], ordered=False, dtype='category')rL   rM   a�  CategoricalIndex(['2011-01-01 09:00:00-05:00', '2011-01-01 10:00:00-05:00',
                  '2011-01-01 11:00:00-05:00', '2011-01-01 12:00:00-05:00',
                  '2011-01-01 13:00:00-05:00'],
                 categories=[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00], ordered=False, dtype='category'))r   r   r   r   ©r   rR   rh   r3   r   r   r   Ú$test_categorical_index_repr_datetime˜  s   z8TestCategoricalRepr.test_categorical_index_repr_datetimec                 C   s”   t dddd�}tt|dd�ƒ}d}t|ƒ|ksJ ‚t ddddd	�}tt|dd�ƒ}d
}t|ƒ|ks3J ‚tt| |¡dd�ƒ}d}t|ƒ|ksHJ ‚d S )NrG   rH   r>   rI   Tr   aP  CategoricalIndex(['2011-01-01 09:00:00', '2011-01-01 10:00:00',
                  '2011-01-01 11:00:00', '2011-01-01 12:00:00',
                  '2011-01-01 13:00:00'],
                 categories=[2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, 2011-01-01 13:00:00], ordered=True, dtype='category')rL   rM   aŒ  CategoricalIndex(['2011-01-01 09:00:00-05:00', '2011-01-01 10:00:00-05:00',
                  '2011-01-01 11:00:00-05:00', '2011-01-01 12:00:00-05:00',
                  '2011-01-01 13:00:00-05:00'],
                 categories=[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00], ordered=True, dtype='category')aA  CategoricalIndex(['2011-01-01 09:00:00-05:00', '2011-01-01 10:00:00-05:00',
                  '2011-01-01 11:00:00-05:00', '2011-01-01 12:00:00-05:00',
                  '2011-01-01 13:00:00-05:00', '2011-01-01 09:00:00-05:00',
                  '2011-01-01 10:00:00-05:00', '2011-01-01 11:00:00-05:00',
                  '2011-01-01 12:00:00-05:00', '2011-01-01 13:00:00-05:00'],
                 categories=[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00], ordered=True, dtype='category'))r   r   r   r   rP   rk   r   r   r   Ú,test_categorical_index_repr_datetime_ordered«  s   z@TestCategoricalRepr.test_categorical_index_repr_datetime_orderedc                 C   s  t dddd�}tt|ƒƒ}d}t|ƒ|ksJ ‚t dddd�}tt|ƒƒ}d}t|ƒ|ks.J ‚t dddd�}tt|ƒƒ}d	}t|ƒ|ksEJ ‚t ddd
d�}tt|ƒƒ}d}t|ƒ|ks\J ‚tt| |¡ƒƒ}d}t|ƒ|ksoJ ‚t ddd
d�}tt|ƒƒ}d}t|ƒ|ks†J ‚d S )NrG   rH   r$   rI   zfCategoricalIndex(['2011-01-01 09:00'], categories=[2011-01-01 09:00], ordered=False, dtype='category')r%   zŒCategoricalIndex(['2011-01-01 09:00', '2011-01-01 10:00'], categories=[2011-01-01 09:00, 2011-01-01 10:00], ordered=False, dtype='category')r1   z²CategoricalIndex(['2011-01-01 09:00', '2011-01-01 10:00', '2011-01-01 11:00'], categories=[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00], ordered=False, dtype='category')r>   a!  CategoricalIndex(['2011-01-01 09:00', '2011-01-01 10:00', '2011-01-01 11:00',
                  '2011-01-01 12:00', '2011-01-01 13:00'],
                 categories=[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00], ordered=False, dtype='category')a©  CategoricalIndex(['2011-01-01 09:00', '2011-01-01 10:00', '2011-01-01 11:00',
                  '2011-01-01 12:00', '2011-01-01 13:00', '2011-01-01 09:00',
                  '2011-01-01 10:00', '2011-01-01 11:00', '2011-01-01 12:00',
                  '2011-01-01 13:00'],
                 categories=[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00], ordered=False, dtype='category')r\   r]   z¤CategoricalIndex(['2011-01', '2011-02', '2011-03', '2011-04', '2011-05'], categories=[2011-01, 2011-02, 2011-03, 2011-04, 2011-05], ordered=False, dtype='category'))r
   r   r   r   rP   rk   r   r   r   Ú"test_categorical_index_repr_periodÈ  s.   z6TestCategoricalRepr.test_categorical_index_repr_periodc                 C   sh   t dddd�}tt|dd�ƒ}d}t|ƒ|ksJ ‚t dd	dd�}tt|dd�ƒ}d
}t|ƒ|ks2J ‚d S )NrG   rH   r>   rI   Tr   a   CategoricalIndex(['2011-01-01 09:00', '2011-01-01 10:00', '2011-01-01 11:00',
                  '2011-01-01 12:00', '2011-01-01 13:00'],
                 categories=[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00], ordered=True, dtype='category')r\   r]   z£CategoricalIndex(['2011-01', '2011-02', '2011-03', '2011-04', '2011-05'], categories=[2011-01, 2011-02, 2011-03, 2011-04, 2011-05], ordered=True, dtype='category'))r
   r   r   r   rk   r   r   r   Ú*test_categorical_index_repr_period_orderedï  s   z>TestCategoricalRepr.test_categorical_index_repr_period_orderedc                 C   s\   t ddd�}tt|ƒƒ}d}t|ƒ|ksJ ‚t ddd�}tt|ƒƒ}d}t|ƒ|ks,J ‚d S )Nra   r>   rb   zšCategoricalIndex(['1 days', '2 days', '3 days', '4 days', '5 days'], categories=[1 days, 2 days, 3 days, 4 days, 5 days], ordered=False, dtype='category')rc   r?   aÒ  CategoricalIndex(['0 days 01:00:00', '1 days 01:00:00', '2 days 01:00:00',
                  '3 days 01:00:00', '4 days 01:00:00', '5 days 01:00:00',
                  '6 days 01:00:00', '7 days 01:00:00', '8 days 01:00:00',
                  '9 days 01:00:00'],
                 categories=[0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, ..., 6 days 01:00:00, 7 days 01:00:00, 8 days 01:00:00, 9 days 01:00:00], ordered=False, dtype='category')©r   r   r   r   rk   r   r   r   Ú%test_categorical_index_repr_timedeltaý  s   z9TestCategoricalRepr.test_categorical_index_repr_timedeltac                 C   sd   t ddd�}tt|dd�ƒ}d}t|ƒ|ksJ ‚t ddd�}tt|dd�ƒ}d	}t|ƒ|ks0J ‚d S )
Nra   r>   rb   Tr   z™CategoricalIndex(['1 days', '2 days', '3 days', '4 days', '5 days'], categories=[1 days, 2 days, 3 days, 4 days, 5 days], ordered=True, dtype='category')rc   r?   aÑ  CategoricalIndex(['0 days 01:00:00', '1 days 01:00:00', '2 days 01:00:00',
                  '3 days 01:00:00', '4 days 01:00:00', '5 days 01:00:00',
                  '6 days 01:00:00', '7 days 01:00:00', '8 days 01:00:00',
                  '9 days 01:00:00'],
                 categories=[0 days 01:00:00, 1 days 01:00:00, 2 days 01:00:00, 3 days 01:00:00, ..., 6 days 01:00:00, 7 days 01:00:00, 8 days 01:00:00, 9 days 01:00:00], ordered=True, dtype='category')rp   rk   r   r   r   Ú-test_categorical_index_repr_timedelta_ordered  s   zATestCategoricalRepr.test_categorical_index_repr_timedelta_orderedc                 C   s$   t tg d¢ƒƒ}d}||ksJ ‚d S )N)r$   Ú2r1   r2   z5[1, '2', 3, 4]
Categories (4, object): [1, 3, 4, '2'])r   r   )r   Úresultr   r   r   r   Útest_categorical_str_repr  s   z-TestCategoricalRepr.test_categorical_str_reprN)r    r!   r"   r/   r0   r4   ÚpytestÚmarkÚskipifr   r:   rD   rF   rS   rT   r[   r_   r`   re   rf   ri   rj   rl   rm   rn   ro   rq   rr   ru   r   r   r   r   r#       s6    þ
>!!!		'r#   )Únumpyr+   rv   Úpandas._configr   Úpandasr   r   r   r   r   r   r	   r
   r   r   r#   r   r   r   r   Ú<module>   s    ,