
    Hh8i                     t    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      Z G d d      Zy)    N)using_string_dtype)	CategoricalCategoricalDtypeCategoricalIndexIndexSeries
date_rangeoption_contextperiod_rangetimedelta_rangec                       e Zd Zd Zy)TestCategoricalReprWithFactorc                     t        g dd      }|rdnd}dd| dg}d	j                  |      }t        |      }||k(  sJ y )
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actuals         u/var/www/app.tikistats.com/public_html/venv/lib/python3.12/site-packages/pandas/tests/arrays/categorical/test_repr.py
test_printz(TestCategoricalReprWithFactor.test_print   sV    EtT+6eW$89
 99X&f!!!    N)__name__
__module____qualname__r!    r"   r    r   r      s    	"r"   r   c                       e Zd Zd Zd Zd Zej                  j                   e	       d      d        Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)TestCategoricalReprc                     t        j                  g ddz        }t        t        g dt                    }t        j                  ||      }g d}dj                  |      }t        |      }||k(  sJ y )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   s         r    test_big_printz"TestCategoricalRepr.test_big_print!   sg    +c12 E/,PQ''U;

 99X&f!!!r"   c                    t        g t        g dt                    }d}t        |      }||k(  sJ ||k(  sJ t        g t        g dt              d      }d}t        |      }||k(  sJ t        g g       }d}|t        |      k(  sJ y )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   s       r    test_empty_printz$TestCategoricalRepr.test_empty_print0   s    Rf!EF@f!!!6!!!Rf!EtTBf6!!!R$34<'''r"   c                     t        t        g d            }d}t        dd       5  |t        |      k(  sJ 	 d d d        y # 1 sw Y   y xY w)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   exps      r    test_print_none_widthz)TestCategoricalRepr.test_print_none_width@   sM    ;|,-C 	
 OT2 	"$q'>!>	" 	" 	"s   A  A	z2Change once infer_string is set to True by default)reasonc                    t        g ddz        }d}t        |      |k(  sJ t        g ddz        }d}t        |      |k(  sJ t        dd      5  t        g ddz        }d}t        |      |k(  sJ 	 d d d        y # 1 sw Y   y xY w)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   s      r    test_unicode_printz&TestCategoricalRepr.test_unicode_printK   s    
 /"453
 Aw("""TWYYZX
 Aw(""" >E 	'X[]]^AXH 7h&&&	' 	' 	's   #A>>Bc                 L   t        g d      }d}t        |      |k(  sJ t        g dg d      }d}t        |      |k(  sJ t        g ddz        }d}t        |      |k(  sJ t        t        j                  d	t        j                  
            }d}t        |      |k(  sJ y )Nr*   r+   r9   z*[1, 2, 3]
Categories (3, int64): [1, 2, 3]r*   r+   r9   r*   r+   r9   r/   z3[1, 2, 3, 1, 2, 3]
Categories (3, int64): [1, 2, 3]r*   r+   r9   r:      
   zU[1, 2, 3, 4, 5, ..., 1, 2, 3, 4, 5]
Length: 50
Categories (5, int64): [1, 2, 3, 4, 5]rB   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   r1   arangeint64r   r   r;   s      r    test_categorical_reprz)TestCategoricalRepr.test_categorical_reprj   s    	"$ Aw#~~*yA$ Aw#~~",-* Aw#~~		"BHH56= Aw#~~r"   c                 Z   t        g dd      }d}t        |      |k(  sJ t        g dg dd      }d}t        |      |k(  sJ t        g dd	z  d      }d
}t        |      |k(  sJ t        t        j                  dt        j                        d      }d}t        |      |k(  sJ y )NrE   Tr   z,[1, 2, 3]
Categories (3, int64): [1 < 2 < 3]rF   r0   r   z5[1, 2, 3, 1, 2, 3]
Categories (3, int64): [1 < 2 < 3]rG   rI   zY[1, 2, 3, 4, 5, ..., 1, 2, 3, 4, 5]
Length: 50
Categories (5, int64): [1 < 2 < 3 < 4 < 5]rB   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]rJ   rM   s      r    test_categorical_repr_orderedz1TestCategoricalRepr.test_categorical_repr_ordered   s    	40& Aw#~~*y$O& Aw#~~",d;. Aw#~~		"BHH5tDA Aw#~~r"   c                 j   t        ddd      }t        |      }d}t        |      |k(  sJ t        |j                  |      |      }d}t        |      |k(  sJ t        dddd	      }t        |      }d
}t        |      |k(  sJ t        |j                  |      |      }d}t        |      |k(  sJ y )N2011-01-01 09:00hrH   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rV   rW   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   r;   s       r    test_categorical_repr_datetimez2TestCategoricalRepr.test_categorical_repr_datetime   s    +#qA 	 Aw#~~

3C8# 	 Aw#~~+#q\R) 	 Aw#~~

3C8
) 	 Aw#~~r"   c                 v   t        ddd      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d	}t        |      |k(  sJ t        dddd
      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d}t        |      |k(  sJ y )NrS   rT   rH   rU   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]rP   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]rX   rY   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]r[   r]   s       r    &test_categorical_repr_datetime_orderedz:TestCategoricalRepr.test_categorical_repr_datetime_ordered   s    +#qAT*O Aw#~~

3CFO Aw#~~+#q\RT*K
 Aw#~~

3CFK
 Aw#~~r"   c                     t        ddt        j                  g      }d}t        |      |k(  sJ t	        ddt        j                  gd      j                  d      }d}t        |      |k(  sJ y )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   r1   nanr   r   astype)r   r   c_expss_exps        r    "test_categorical_repr_int_with_nanz6TestCategoricalRepr.test_categorical_repr_int_with_nan   si    Arvv'@Aw%Aq"&&>299*E! Aw%r"   c                 h   t        ddd      }t        |      }d}t        |      |k(  sJ t        |j                  |      |      }d}t        |      |k(  sJ t        dd	d      }t        |      }d
}t        |      |k(  sJ t        |j                  |      |      }d}t        |      |k(  sJ y )NrS   rT   rH   rU   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   r\   r]   s       r    test_categorical_repr_periodz0TestCategoricalRepr.test_categorical_repr_period
  s    -CC1 Aw#~~

3C81 Aw#~~93:L Aw#~~

3C8L Aw#~~r"   c                 t   t        ddd      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d	}t        |      |k(  sJ t        d
dd      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d}t        |      |k(  sJ y )NrS   rT   rH   rU   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]rP   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]rk   rl   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]rm   r]   s       r    $test_categorical_repr_period_orderedz8TestCategoricalRepr.test_categorical_repr_period_ordered'  s    -CCT*1 Aw#~~

3CF1 Aw#~~93:T*P Aw#~~

3CFP Aw#~~r"   c                 d   t        dd      }t        |      }d}t        |      |k(  sJ t        |j                  |      |      }d}t        |      |k(  sJ t        dd      }t        |      }d	}t        |      |k(  sJ t        |j                  |      |      }d
}t        |      |k(  sJ y )N1 daysrH   rW   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 hoursrB   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   r\   r]   s       r    test_categorical_repr_timedeltaz3TestCategoricalRepr.test_categorical_repr_timedeltaD  s    h2M Aw#~~

3C8M Aw#~~i4J Aw#~~

3C8J Aw#~~r"   c                 p   t        dd      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d}t        |      |k(  sJ t        d	d
      }t        |d      }d}t        |      |k(  sJ t        |j                  |      |d      }d}t        |      |k(  sJ y )Nrr   rH   rs   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]rP   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]rt   rB   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]ru   r]   s       r    'test_categorical_repr_timedelta_orderedz;TestCategoricalRepr.test_categorical_repr_timedelta_orderede  s    h2T*Q Aw#~~

3CFQ Aw#~~i4T*K Aw#~~

3CFK Aw#~~r"   c                     t        t        g d            }d}t        |      |k(  sJ t        t        t        j                  dt        j
                                    }d}t        |      |k(  sJ y )NrE   zRCategoricalIndex([1, 2, 3], categories=[1, 2, 3], ordered=False, dtype='category')rI   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   r1   rK   rL   )r   r^   r;   is       r    test_categorical_index_reprz/TestCategoricalRepr.test_categorical_index_repr  s^    {956fCyC[2RXX)FGH PAw#~~r"   c                     t        t        g dd            }d}t        |      |k(  sJ t        t        t        j                  dt        j
                        d            }d}t        |      |k(  sJ y )NrE   Tr   zQCategoricalIndex([1, 2, 3], categories=[1, 2, 3], ordered=True, dtype='category')rI   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')rz   )r   r{   r;   s      r    #test_categorical_index_repr_orderedz7TestCategoricalRepr.test_categorical_index_repr_ordered  sa    [DABeAw#~~[2RXX)FPTUV OAw#~~r"   c                     t        ddd      }t        t        |            }d}t        |      |k(  sJ t        dddd      }t        t        |            }d}t        |      |k(  sJ y )	NrS   rT   rH   rU   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')rX   rY   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   r^   r{   r;   s       r    $test_categorical_index_repr_datetimez8TestCategoricalRepr.test_categorical_index_repr_datetime  st    +#qA[-.k
 Aw#~~+#q\R[-.I
 Aw#~~r"   c                 L   t        ddd      }t        t        |d            }d}t        |      |k(  sJ t        dddd	      }t        t        |d            }d
}t        |      |k(  sJ t        t        |j	                  |      d            }d}t        |      |k(  sJ y )NrS   rT   rH   rU   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')rX   rY   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   r\   r   s       r    ,test_categorical_index_repr_datetime_orderedz@TestCategoricalRepr.test_categorical_index_repr_datetime_ordered  s    +#qA[d;<j
 Aw#~~+#q\R[d;<H
 Aw#~~[C$GHH Aw#~~r"   c                 v   t        ddd      }t        t        |            }d}t        |      |k(  sJ t        ddd      }t        t        |            }d}t        |      |k(  sJ t        ddd      }t        t        |            }d	}t        |      |k(  sJ t        ddd
      }t        t        |            }d}t        |      |k(  sJ t        t        |j	                  |                  }d}t        |      |k(  sJ t        ddd
      }t        t        |            }d}t        |      |k(  sJ y )NrS   rT   r*   rU   zfCategoricalIndex(['2011-01-01 09:00'], categories=[2011-01-01 09:00], ordered=False, dtype='category')r+   zCategoricalIndex(['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')r9   zCategoricalIndex(['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')rH   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')rk   rl   zCategoricalIndex(['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   r\   r   s       r    "test_categorical_index_repr_periodz6TestCategoricalRepr.test_categorical_index_repr_period  s?   -CC[-.zAw#~~-CC[-. aAw#~~-CC[-. GAw#~~-CC[-.\ Aw#~~[C9:\ Aw#~~93:[-. yAw#~~r"   c                     t        ddd      }t        t        |d            }d}t        |      |k(  sJ t        dd	d      }t        t        |d            }d
}t        |      |k(  sJ y )NrS   rT   rH   rU   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')rk   rl   zCategoricalIndex(['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   r   s       r    *test_categorical_index_repr_period_orderedz>TestCategoricalRepr.test_categorical_index_repr_period_ordered  ss    -CC[d;<[ Aw#~~93:[d;< xAw#~~r"   c                     t        dd      }t        t        |            }d}t        |      |k(  sJ t        dd      }t        t        |            }d}t        |      |k(  sJ y )Nrr   rH   rs   zCategoricalIndex(['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')rt   rI   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   r   s       r    %test_categorical_index_repr_timedeltaz9TestCategoricalRepr.test_categorical_index_repr_timedelta  sj    h2[-. oAw#~~i4[-.O Aw#~~r"   c                     t        dd      }t        t        |d            }d}t        |      |k(  sJ t        dd      }t        t        |d            }d	}t        |      |k(  sJ y )
Nrr   rH   rs   Tr   zCategoricalIndex(['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')rt   rI   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')r   r   s       r    -test_categorical_index_repr_timedelta_orderedzATestCategoricalRepr.test_categorical_index_repr_timedelta_ordered  sn    h2[d;< nAw#~~i4[d;<N Aw#~~r"   c                 B    t        t        g d            }d}||k(  sJ y )N)r*   2r9   r:   z5[1, '2', 3, 4]
Categories (4, object): [1, 3, 4, '2'])r   r   )r   resultr   s      r    test_categorical_str_reprz-TestCategoricalRepr.test_categorical_str_repr  s$    k.12K!!!r"   N)r#   r$   r%   r5   r7   r<   pytestmarkskipifr   rC   rN   rQ   r_   ra   ri   rn   rp   rv   rx   r|   r~   r   r   r   r   r   r   r   r&   r"   r    r(   r(       s    "( 	" [[C  '	'666<|B	 ::BB&:%N  "r"   r(   )numpyr1   r   pandas._configr   pandasr   r   r   r   r   r	   r
   r   r   r   r(   r&   r"   r    <module>r      s3      -
 
 

" 
"A" A"r"   