
    m*iBA                         S SK J r Jr  S SKrS SKrS SKrS SKJrJrJ	r	J
r
JrJrJrJr  S SKJr   " S S5      r " S S5      rg)    )datetime	timedeltaN)Categorical	DataFrameIndexSeries
date_rangeoption_contextperiod_rangetimedelta_rangec                      \ rS rSrS rS rS rS rS r\	R                  R                  SSS	/5      S
 5       rS rS rS rS r\	R                  R                  S/ SQ5      S 5       rS r\	R                  R                  SSS/5      S 5       rS r\	R                  R                  SSS/SS//5      S 5       rS rS rS  rS! rS" rS# rS$ rS% rS& rS' rS( r S) r!Sr"g)*TestSeriesRepr   c                     [         R                  R                  [        SS5      [        SS5      /SS /S9n[	        SUS9n[        U5      nSnX4:X  d   eg )	N         r   )namesg      ?indexz0   
2  3    1.5
dtype: float64)pd
MultiIndexfrom_productranger   repr)selfmiserresexpecteds        `/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/pandas/tests/series/test_formats.pytest_multilevel_name_print_0+TestSeriesRepr.test_multilevel_name_print_0   sV     ]]''q!eAqk(B1d)'TS#3i6    c                     Un[        [        [        U5      5      USS9n/ SQnSR                  U5      n[	        U5      U:X  d   eg )Nsthr   name)zfirst  secondzfoo    one       0z       two       1z       three     2zbar    one       3z       two       4zbaz    two       5z       three     6zqux    one       7z       two       8z       three     9zName: sth, dtype: int64
)r   r   lenjoinr   )r   %lexsorted_two_level_string_multiindexr   r   r    s        r!   test_multilevel_name_print)TestSeriesRepr.test_multilevel_name_print"   sG    5U3u:&e%@
 99X&CyH$$$r$   c                 ~    [        / SQ5      nSUl        S[        U5      ;   d   eS Ul        S[        U5      ;  d   eg )N)r      r   test
Name: testName:)r   r(   r   r   ss     r!   test_small_name_printing'TestSeriesRepr.test_small_name_printing6   s>    9tAw&&&d1g%%%r$   c                     [        [        S5      5      nSUl        S[        U5      ;   d   eS Ul        S[        U5      ;  d   eg )N  r1   r2   r3   )r   r   r(   r   r4   s     r!   test_big_name_printing%TestSeriesRepr.test_big_name_printing@   sB    5;tAw&&&d1g%%%r$   c                 X    [        [        SS5      S[        S9nS[        U5      ;   d   eg )N2001010120020101r1   )r   r(   dtyper2   )r   r	   objectr   r4   s     r!   test_empty_name_printing'TestSeriesRepr.test_empty_name_printingJ   s*    J
;&PVWtAw&&&r$   args )r   c           	          [        [        [        R                  R	                  S5      R                  S5      [        R                  " S/UQ76 S95        g )Nr   r9   r   )strr   nprandomdefault_rngstandard_normalarange)r   rC   s     r!   test_float_rangeTestSeriesRepr.test_float_rangeN   s@    		%%a(88>ii,t,	
r$   c                 0    [        [        [        S95        g )Nr?   )rG   r   r@   r   s    r!   test_empty_object TestSeriesRepr.test_empty_objectW   s    F !r$   c                     [        U5        [        UR                  [        5      5        [        R                  USS& [        U5        g )N      )rG   astypeintrH   nan)r   string_seriess     r!   test_stringTestSeriesRepr.test_string[   s7    MM  %&  VVaMr$   c                     [        U5        g N)rG   )r   object_seriess     r!   test_objectTestSeriesRepr.test_objectc   s
    Mr$   c                 b    [        U5        UR                  S5      nS US S S2'   [        U5        g )NOr   )rG   rW   r   )r   datetime_seriesotss      r!   test_datetimeTestSeriesRepr.test_datetimef   s.    O$$S)CaCS	r$   r(   ) r0   g333333?foou   αβγ7loooooooooooooooooooooooooooooooooooooooooooooooooooongri   barbaz)r0   r   )ri   r0   gffffff@)   αu   βu   γ)rn   rl   c                 &    Xl         [        U5        g r^   )r(   r   )r   r(   rZ   s      r!   test_various_names!TestSeriesRepr.test_various_namesm   s    $ "]r$   c                     [        [        R                  R                  S5      R	                  S5      [        R
                  " S5      SS9n[        U5        g )Nr   r9   rk   r'   )r   rH   rI   rJ   rK   rL   r   )r   biggies     r!   test_tuple_nameTestSeriesRepr.test_tuple_name   s@    II!!!$44T:))D/&

 	Vr$   argd     c                     [        [        R                  R                  S5      R	                  U5      SS9n[        U5      nSU;   d   eg )Nr   r   r(   zName: 0)r   rH   rI   rJ   rK   r   )r   rv   r   rep_strs       r!   test_tidy_repr_name_0$TestSeriesRepr.test_tidy_repr_name_0   sA     RYY**1-==cBKs)G###r$   c           	          [        S/S[        S/US9US9nS[        U5      ;  d   eS[        U5      ;  d   eS[        U5      ;  d   eg )	Nza
	bza
	dza
	frP   )r(   r   r?   	za
)r   r   r   )r   any_string_dtyper   s      r!   test_newlineTestSeriesRepr.test_newline   s\    L,<="	
 49$$$49$$$DI%%%r$   zname, expectedri   z#Series([], Name: foo, dtype: int64)NzSeries([], dtype: int64)c                 X    [        / [        R                  US9n[        U5      U:X  d   eg )N)r?   r(   )r   rH   int64r   )r   r(   r    r5   s       r!   test_empty_int64TestSeriesRepr.test_empty_int64   s(     2RXXD1Aw("""r$   c           
         [        [        S5       Vs/ s H:  n[        [        R                  R                  S5      R                  S5      5      PM<     sn5      n[        U5        UR                  5       nUR                  S:X  d   eg s  snf )NrU   r   )r   r   rh   )
r   r   r   rH   rI   rJ   rK   r   
readouterrerr)r   capsysir5   captureds        r!   test_repr_bool_fails#TestSeriesRepr.test_repr_bool_fails   sz     q!A "))//2BB6JK!
 	Q$$&||r!!!s   AB	c                 ~    [        / SQ[        R                  " S5      S9n[        U5        SUl        [        U5        g )Nr0   r   r   r   rz   )   אr   )r   rH   r   r   r(   r4   s     r!   !test_repr_name_iterable_indexable0TestSeriesRepr.test_repr_name_iterable_indexable   s-    9288A;/ 	Q Qr$   c                     [        SS 5         [        [        [        S5      5      5        S S S 5        g ! , (       d  f       g = f)Ndisplay.max_rowsrx   )r
   rG   r   r   rQ   s    r!   test_repr_max_rows!TestSeriesRepr.test_repr_max_rows   s*    .5uT{#$ 655s	   4
Ac                     [        S/SS9n[        U5        [        S/S-  5      n[        U5        [        S/S-  5      nSUl        [        U5        g )Nr   u   בrz   u   σ
   r9   title1)r   rG   r   r(   )r   dfr   ser2s       r!    test_unicode_string_with_unicode/TestSeriesRepr.test_unicode_string_with_unicode   sM    XJX.BhZ"_%S	xj4'(	T
r$   c                     [        S/SS9nSn[        R                  " [        US9   [	        U5        S S S 5        g ! , (       d  f       g = f)Nabcrz   z2^'str' object cannot be interpreted as an integer$match)r   pytestraises	TypeErrorbytes)r   r   msgs      r!   test_str_to_bytes_raises'TestSeriesRepr.test_str_to_bytes_raises   s6    UG%(B]]9C0"I 100s	   <
A
c           
         [        [        S5       Vs/ s H  n[        SSS5      [        U5      -   PM     sn[        S9n[        [        R                  R                  S5      R                  [        U5      5      U5      n[        U5        [        [        R                  " S[        R                  S9[        SSS9S	9n[        U5      R                  5       S
   R!                  S5      (       d   eUR"                  [        R                  R                  S5      R%                  S[        U5      S-
  S5         n[        U5      R                  5       S
     g s  snf )Nr9     r0   rP   r      z
2020-01-01periodsr   rE   zFreq:r   i  )r   r   r   r   r@   r   rH   rI   rJ   rK   r*   r   rL   float64r	   
splitlines
startswithilocintegers)r   r   r   tsts2s        r!   !test_timeseries_repr_object_dtype0TestSeriesRepr.test_timeseries_repr_object_dtype   s	   :?+F+QXdAq!IaL0+Ff
 BII))!,<<SZH%PRIIb

+:lTV3W
 Bx""$R(33G<<<<ggbii++A.773r7Q;LMS	r" Gs   #Ec                     [         R                  " S5        Sn[        SS SS5         [        / SQ5      nXR	                  5       :X  d   e S S S 5        WR	                  5       b   eg ! , (       d  f       N"= f)Njinja2zj\begin{tabular}{ll}
\toprule
 & 0 \\
\midrule
0 & $\alpha$ \\
1 & b \\
2 & c \\
\bottomrule
\end{tabular}
zstyler.format.escapezstyler.render.reprlatex)z$\alpha$bc)r   importorskipr
   r   _repr_latex_)r   resultr5   s      r!   test_latex_reprTestSeriesRepr.test_latex_repr   sp    H%	 "D*>
 ./A^^----	
 ~~'''
 
s   #A''
A5c                 x    [        S[        R                  /5      n[        SS/US9nSn[	        U5      U:X  d   eg )Nr0   r   r   z1.0    1
NaN    2
dtype: int64)r   rH   rY   r   r   )r   r   r5   exps       r!   !test_index_repr_in_frame_with_nan0TestSeriesRepr.test_index_repr_in_frame_with_nan   s9    1bff+Aq6#4Aw#~~r$   c                     [        SSSS9nSn[        R                  " [        US9   UR	                  5         S S S 5        [        SUS9n[        U5        g ! , (       d  f       N$= f)	Nz1/1/1850z1/1/1950zYE-DEC)freqz"DatetimeIndex.format is deprecatedr   r0   r   )r	   tmassert_produces_warningFutureWarningformatr   r   )r   rngr   r   s       r!   test_format_pre_1900_dates)TestSeriesRepr.test_format_pre_1900_dates  sQ    Zh?2''SAJJL BAS!R BAs   A
A$c                 x    [        SSS[        R                  R                  /SS9n[	        U5      nSnX#:X  d   eg )Nr   r9   r   zM8[ns]rP   z0   1970-01-01 00:00:00.000000
1   1970-01-01 00:00:00.000001
2   1970-01-01 00:00:00.000002
3                          NaT
dtype: datetime64[ns])r   r   NaT_valuer   )r   seriesr   r    s       r!   test_series_repr_nat#TestSeriesRepr.test_series_repr_nat	  s@    D$6hGf$ 	 !!!r$   c                 h    [        S/5      R                  [        5      nSn[        U5      U:X  d   eg )Ng      ?z0    1.0
dtype: object)r   rW   r@   r   )r   r   r    s      r!   test_float_reprTestSeriesRepr.test_float_repr  s1     cUm""6*,CyH$$$r$   c                     [        / SQSS [        R                  [        R                  /5      n[        U5      nSnX#:X  d   eg )Nr0   r   r   r   Tz4True    1
None    2
NaN     3
NaT     4
dtype: int64)r   rH   rY   r   r   r   )r   r   r   r    s       r!   test_different_null_objects*TestSeriesRepr.test_different_null_objects  s9    \D$#?@cM!!!r$   )#__name__
__module____qualname____firstlineno__r"   r-   r6   r:   rA   r   markparametrizerM   rR   r[   r`   rf   rp   rt   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__rD   r$   r!   r   r      s/   %(&&' [[Vb']3
 4
" [[	
 ! 
 [[US$K0$ 1$	& [[9:-.	
##
"%
	#(("%"r$   r   c                   P    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rSrg)TestCategoricalRepri%  c                      " S S5      n[        [        S5       Vs/ s H	  o!" 5       PM     sn5      n[        U5      nUR                  5       n[	        U5        [        U5        g s  snf )Nc                   *    \ rS rSrSrSrS\4S jrSrg)ATestCategoricalRepr.test_categorical_repr_unicode.<locals>.Countyi)  u   San SebastiánPRreturnc                 :    U R                   S-   U R                  -   $ )Nz, )r(   staterQ   s    r!   __repr__JTestCategoricalRepr.test_categorical_repr_unicode.<locals>.County.__repr__-  s    yy4'$**44r$   rD   N)	r   r   r   r   r(   r   rG   r   r   rD   r$   r!   Countyr   )  s    #DE5# 5r$   r   =   )r   r   r   	to_seriesr   rG   )r   r   _catidxr   s         r!   test_categorical_repr_unicode1TestCategoricalRepr.test_categorical_repr_unicode&  sT    	5 	5 U2Y7Y68Y78CjmmoS	C 8s   A&c                    [        [        / SQ5      5      nSnX2R                  5       :X  d   e[        [        SS/S-  5      5      nSnU(       a  UR                  SS5      n[	        S	S
5         U[        U5      :X  d   e S S S 5        [        S5      n[        [        SS/USS95      nSnU(       a  UR                  SS5      nX2R                  5       :X  d   eg ! , (       d  f       N`= f)Nr   zO0    1
1    2
2    3
3    4
dtype: category
Categories (4, int64): [1, 2, 3, 4]ar      zf0     a
1     b
     ..
48    a
49    b
Length: 50, dtype: category
Categories (2, object): ['a', 'b']r@   rG   r   rU   abcdefghijklmnopqrstuvwxyzT)
categoriesorderedzh0    a
1    b
dtype: category
Categories (26, object): ['a' < 'b' < 'c' < 'd' ... 'w' < 'x' < 'y' < 'z'])r   r   __str__replacer
   r   list)r   using_infer_stringr   r   levss        r!   test_categorical_repr)TestCategoricalRepr.test_categorical_repr7  s    ;|,-C 	
 iik!!!;SzB/0N 	 ++h.C.2$q'>!> 3 01;SzdDIJ% 	 ++h.Ciik!!! 32s   .C
C)c                    [        [        / SQ5      5      nSn[        U5      U:X  d   e[        [        [        R                  " S5      5      5      nS[        R
                  " [        5       S3n[        U5      U:X  d   eg )Nr   zE0    1
1    2
2    3
dtype: category
Categories (3, int64): [1, 2, 3]r   f0    0
1    1
2    2
3    3
4    4
5    5
6    6
7    7
8    8
9    9
dtype: category
Categories (10, z ): [0, 1, 2, 3, ..., 6, 7, 8, 9]r   r   r   rH   rL   r?   rX   r   r5   r   s      r!   test_categorical_series_repr0TestCategoricalRepr.test_categorical_series_reprX  sr    ;y)*$ Aw#~~;ryy}-. #?C Aw#~~r$   c                     [        [        / SQSS95      nSn[        U5      U:X  d   e[        [        [        R                  " S5      SS95      nS[        R
                  " [        5       S3n[        U5      U:X  d   eg )Nr   Tr   zG0    1
1    2
2    3
dtype: category
Categories (3, int64): [1 < 2 < 3]r   r  z$): [0 < 1 < 2 < 3 ... 6 < 7 < 8 < 9]r  r  s      r!   $test_categorical_series_repr_ordered8TestCategoricalRepr.test_categorical_series_repr_orderedr  sv    ;y$78& Aw#~~;ryy}d;< #CG Aw#~~r$   c                     [        SSSS9n[        [        U5      5      nSn[        U5      U:X  d   e[        SSSSS9n[        [        U5      5      nSn[        U5      U:X  d   eg )	N2011-01-01 09:00hrU   r   r   a2  0   2011-01-01 09:00:00
1   2011-01-01 10:00:00
2   2011-01-01 11:00:00
3   2011-01-01 12:00:00
4   2011-01-01 13:00:00
dtype: category
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r   r   tza  0   2011-01-01 09:00:00-05:00
1   2011-01-01 10:00:00-05:00
2   2011-01-01 11:00:00-05:00
3   2011-01-01 12:00:00-05:00
4   2011-01-01 13:00:00-05:00
dtype: category
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   r   r   r   r5   r   s       r!   %test_categorical_series_repr_datetime9TestCategoricalRepr.test_categorical_series_repr_datetime  st    +#qA;s#$N Aw#~~+#q\R;s#$K Aw#~~r$   c                     [        SSSS9n[        [        USS95      nSn[        U5      U:X  d   e[        SSSSS	9n[        [        USS95      nS
n[        U5      U:X  d   eg )Nr  r  rU   r  Tr  a6  0   2011-01-01 09:00:00
1   2011-01-01 10:00:00
2   2011-01-01 11:00:00
3   2011-01-01 12:00:00
4   2011-01-01 13:00:00
dtype: category
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  r  a  0   2011-01-01 09:00:00-05:00
1   2011-01-01 10:00:00-05:00
2   2011-01-01 11:00:00-05:00
3   2011-01-01 12:00:00-05:00
4   2011-01-01 13:00:00-05:00
dtype: category
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_series_repr_datetime_orderedATestCategoricalRepr.test_categorical_series_repr_datetime_ordered  sx    +#qA;sD12O Aw#~~+#q\R;sD12K Aw#~~r$   c                     [        SSSS9n[        [        U5      5      nSn[        U5      U:X  d   e[        SSSS9n[        [        U5      5      nSn[        U5      U:X  d   eg )	Nr  r  rU   r  a  0    2011-01-01 09:00
1    2011-01-01 10:00
2    2011-01-01 11:00
3    2011-01-01 12:00
4    2011-01-01 13:00
dtype: category
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Mz0    2011-01
1    2011-02
2    2011-03
3    2011-04
4    2011-05
dtype: category
Categories (5, period[M]): [2011-01, 2011-02, 2011-03, 2011-04, 2011-05]r   r   r   r   r  s       r!   #test_categorical_series_repr_period7TestCategoricalRepr.test_categorical_series_repr_period  sp    -CC;s#$1 Aw#~~93:;s#$L Aw#~~r$   c                     [        SSSS9n[        [        USS95      nSn[        U5      U:X  d   e[        SS	SS9n[        [        USS95      nS
n[        U5      U:X  d   eg )Nr  r  rU   r  Tr  a  0    2011-01-01 09:00
1    2011-01-01 10:00
2    2011-01-01 11:00
3    2011-01-01 12:00
4    2011-01-01 13:00
dtype: category
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  z0    2011-01
1    2011-02
2    2011-03
3    2011-04
4    2011-05
dtype: category
Categories (5, period[M]): [2011-01 < 2011-02 < 2011-03 < 2011-04 < 2011-05]r  r  s       r!   +test_categorical_series_repr_period_ordered?TestCategoricalRepr.test_categorical_series_repr_period_ordered  st    -CC;sD121 Aw#~~93:;sD12P Aw#~~r$   c                     [        SSS9n[        [        U5      5      nSn[        U5      U:X  d   e[        SSS9n[        [        U5      5      nSn[        U5      U:X  d   eg )N1 daysrU   r   z0   1 days
1   2 days
2   3 days
3   4 days
4   5 days
dtype: category
Categories (5, timedelta64[ns]): [1 days, 2 days, 3 days, 4 days, 5 days]1 hoursr   a  0   0 days 01:00:00
1   1 days 01:00:00
2   2 days 01:00:00
3   3 days 01:00:00
4   4 days 01:00:00
5   5 days 01:00:00
6   6 days 01:00:00
7   7 days 01:00:00
8   8 days 01:00:00
9   9 days 01:00:00
dtype: category
Categories (10, timedelta64[ns]): [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]r   r   r   r   r  s       r!   &test_categorical_series_repr_timedelta:TestCategoricalRepr.test_categorical_series_repr_timedelta  sl    h2;s#$M Aw#~~i4;s#$H Aw#~~r$   c                     [        SSS9n[        [        USS95      nSn[        U5      U:X  d   e[        SSS9n[        [        USS95      nS	n[        U5      U:X  d   eg )
Nr&  rU   r   Tr  z0   1 days
1   2 days
2   3 days
3   4 days
4   5 days
dtype: category
Categories (5, timedelta64[ns]): [1 days < 2 days < 3 days < 4 days < 5 days]r'  r   a  0   0 days 01:00:00
1   1 days 01:00:00
2   2 days 01:00:00
3   3 days 01:00:00
4   4 days 01:00:00
5   5 days 01:00:00
6   6 days 01:00:00
7   7 days 01:00:00
8   8 days 01:00:00
9   9 days 01:00:00
dtype: category
Categories (10, timedelta64[ns]): [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]r(  r  s       r!   .test_categorical_series_repr_timedelta_orderedBTestCategoricalRepr.test_categorical_series_repr_timedelta_ordered  sp    h2;sD12Q Aw#~~i4;sD12I Aw#~~r$   rD   N)r   r   r   r   r   r  r  r  r  r  r   r#  r)  r,  r   rD   r$   r!   r   r   %  s6    ""B448844@r$   r   )r   r   numpyrH   r   pandasr   r   r   r   r   r	   r
   r   r   pandas._testing_testingr   r   r   rD   r$   r!   <module>r2     sB   
   	 	 	 K" K"\Q Qr$   