
     j                        d dl Z d dlmZ d dlmZ d dlZd dlZd dlmZmZ d dl	m
Z  ej        d           d Zej        d             Z G d d	          Z G d
 d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d d          ZdS )    N)datetime)dedent)	DataFrameSeriesjinja2c                 D    t          |                                           S )zDedent without new line in the beginning.

    Built-in textwrap.dedent would keep new line character in the beginning
    of multi-line string starting from the new line.
    This version drops the leading new line character.
    )r   lstrip)strings    yC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\pandas/tests/io/formats/test_to_latex.py_dedentr      s     &>>  """    c                  .    t          ddgddgd          S )z>Short dataframe for testing table/tabular/longtable LaTeX env.      b1b2abr    r   r   df_shortr      s"     Aq6t55666r   c                       e Zd Zd Zd Zd Zd Zd Zej	        
                    dddd	d
gdh dd
d	dg          d             Zd Zd Zd Zd Zd Zd Zd ZdS )TestToLatexc                 6   t          j        d          5 }|                    |           t          |d          5 }|                                |                                k    sJ 	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Ntest.texutf-8encoding)tmensure_cleanto_latexopenread)selffloat_framepathfs       r   test_to_latex_to_filez!TestToLatex.test_to_latex_to_file"   s   _Z(( 	:D  &&&dW--- :"++--99999: : : : : : : : : : : : : : :	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s4   'B-A6*B6A:	:B=A:	>BBBc                 h   t          dgg          }t          j        d          5 }|                    |d           t	          j        |dd          5 }|                                |                                k    sJ 	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )N
   außgangenr   r   r   rr   r    r!   r"   codecsr#   r$   r%   dfr'   r(   s       r   (test_to_latex_to_file_utf8_with_encodingz4TestToLatex.test_to_latex_to_file_utf8_with_encoding(   s)   ()**_Z(( 	1DKKwK///T3999 1Q{{}}000001 1 1 1 1 1 1 1 1 1 1 1 1 1 1	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1s5   /B'-BB'B	B'B	B''B+.B+c                 d   t          dgg          }t          j        d          5 }|                    |           t	          j        |dd          5 }|                                |                                k    sJ 	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr+   r   r,   r   r   r-   r/   s       r   +test_to_latex_to_file_utf8_without_encodingz7TestToLatex.test_to_latex_to_file_utf8_without_encoding0   s%   ()**_Z(( 	1DKKT3999 1Q{{}}000001 1 1 1 1 1 1 1 1 1 1 1 1 1 1	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1s5   -B%-BB%B	B%B	B%%B),B)c                     t          ddgddgd          }|                                }t          d          }||k    sJ d S )Nr   r   r   r   r   
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r   r"   r   r%   r0   resultexpecteds       r    test_to_latex_tabular_with_indexz,TestToLatex.test_to_latex_tabular_with_index8   sY    aV4,7788	
 
 !!!!!!r   c                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   Findexz
            \begin{tabular}{rl}
            \toprule
            a & b \\
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   #test_to_latex_tabular_without_indexz/TestToLatex.test_to_latex_tabular_without_indexI   s_    aV4,77885))	
 
 !!!!!!r   bad_column_format   g333333?lr,   )r,   c>   rB   rA   r,   r   c                     t          ddgddgd          }d}t          j        t          |          5  |                    |           d d d            d S # 1 swxY w Y   d S )	Nr   r   r   r   r   z&`column_format` must be str or unicodematchcolumn_formatr   pytestraises
ValueErrorr"   )r%   r?   r0   msgs       r   test_to_latex_bad_column_formatz+TestToLatex.test_to_latex_bad_column_formatZ   s    
 aV4,77887]:S111 	9 	9KK&7K888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s   AAAc                 2    |                     d           d S )NlcrrF   r"   )r%   r&   s     r   &test_to_latex_column_format_just_worksz2TestToLatex.test_to_latex_column_format_just_worksd   s    511111r   c                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   rO   rF   z
            \begin{tabular}{lcr}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   test_to_latex_column_formatz'TestToLatex.test_to_latex_column_formath   s_    aV4,7788511	
 
 !!!!!!r   c                     t          ddg          }|                    dj                  }t          d          }||k    sJ d S )Ng     @@testz{:,.0f}float_formatz
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & 1,000 \\
            1 & test \\
            \bottomrule
            \end{tabular}
            )r   r"   formatr   )r%   serr8   r9   s       r   %test_to_latex_float_format_object_colz1TestToLatex.test_to_latex_float_format_object_coly   sW    ff%&&9+;<<	
 
 !!!!!!r   c                 x    t                      }|                                }t          d          }||k    sJ d S )Nz
            \begin{tabular}{l}
            \toprule
            \midrule
            \bottomrule
            \end{tabular}
            r6   r7   s       r   test_to_latex_empty_tabularz'TestToLatex.test_to_latex_empty_tabular   sE    [[
 
 !!!!!!r   c                 ~    t          g d          }|                                }t          d          }||k    sJ d S )Nr   r   rB   z
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & a \\
            1 & b \\
            2 & c \\
            \bottomrule
            \end{tabular}
            )r   r"   r   )r%   sr8   r9   s       r   test_to_latex_seriesz TestToLatex.test_to_latex_series   sM    ???##

 
 !!!!!!r   c                     t          dddgi          }d|j        _        |                    d          }t	          d          }||k    sJ d S )Nr   r   r   fooF)index_namesz
            \begin{tabular}{lr}
            \toprule
             & a \\
            \midrule
            0 & 1 \\
            1 & 2 \\
            \bottomrule
            \end{tabular}
            )r   r=   namer"   r   r7   s       r   test_to_latex_midrule_locationz*TestToLatex.test_to_latex_midrule_location   s`    aV}%%//	
 
 !!!!!!r   c                     t          ddgddgddgd          }d}t          j        t          |	          5  |                    d d            d d d            d S # 1 swxY w Y   d S )
NRaphael	Donatello   -   g(\f@g4f@)rd   ageheightznStarting with pandas version 3.0 all arguments of to_latex except for the argument 'buf' will be keyword-only.rD   )r   r    assert_produces_warningFutureWarningr"   )r%   r0   rL   s      r   "test_to_latex_pos_args_deprecationz.TestToLatex.test_to_latex_pos_args_deprecation   s    "K0Bx!6* 
 
8 	 'SAAA 	$ 	$KKd###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s   AA"AN)__name__
__module____qualname__r)   r1   r3   r:   r>   rI   markparametrizerM   rQ   rS   rZ   r\   r`   re   ro   r   r   r   r   r   !   s       : : :1 1 11 1 1" " """ " "" [	
C#sZ#:N:NO 9 9	 92 2 2" " """ " "$" " "" " "$" " "&$ $ $ $ $r   r   c                       e Zd Zd Zd Zd Zej                            d e	dddgi          df e	ddgdd	gd
          df e	ddgdd	gddgd          dfg          d             Z
dS )TestToLatexLongtablec                 |    t                      }|                    d          }t          d          }||k    sJ d S )NT	longtableaw  
            \begin{longtable}{l}
            \toprule
            \midrule
            \endfirsthead
            \toprule
            \midrule
            \endhead
            \midrule
            \multicolumn{0}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            \end{longtable}
            r6   r7   s       r   test_to_latex_empty_longtablez2TestToLatexLongtable.test_to_latex_empty_longtable   sK    [[t,,
 
$ !!!!!!r   c                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   Trx   a  
            \begin{longtable}{lrl}
            \toprule
             & a & b \\
            \midrule
            \endfirsthead
            \toprule
             & a & b \\
            \midrule
            \endhead
            \midrule
            \multicolumn{3}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \end{longtable}
            r6   r7   s       r   "test_to_latex_longtable_with_indexz7TestToLatexLongtable.test_to_latex_longtable_with_index   s_    aV4,7788t,,
 
, !!!!!!r   c                     t          ddgddgd          }|                    dd          }t          d	          }||k    sJ d S )
Nr   r   r   r   r   FTr=   ry   a  
            \begin{longtable}{rl}
            \toprule
            a & b \\
            \midrule
            \endfirsthead
            \toprule
            a & b \\
            \midrule
            \endhead
            \midrule
            \multicolumn{2}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            1 & b1 \\
            2 & b2 \\
            \end{longtable}
            r6   r7   s       r   %test_to_latex_longtable_without_indexz:TestToLatexLongtable.test_to_latex_longtable_without_index  sa    aV4,77885D99
 
, !!!!!!r   zdf, expected_numberr   r   r         r   r@      r^   c                 H    |                     dd          }d| d|v sJ d S )NFTr~   z\multicolumn{}rP   )r%   r0   expected_numberr8   s       r   .test_to_latex_longtable_continued_on_next_pagezCTestToLatexLongtable.test_to_latex_longtable_continued_on_next_page  s;     5D994444>>>>>>r   N)rp   rq   rr   rz   r|   r   rI   rs   rt   r   r   r   r   r   rv   rv      s        " " "." " "6" " "6 [YaV}%%q)YaV1a&1122A6YaV1a&1v>>??C	
 ? ? ? ? ?r   rv   c                       e Zd Zd Zd Zd Zd Zej        	                    ddgdfdd	d
g          d             Z
d ZdS )TestToLatexHeaderc                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   Fheaderz
            \begin{tabular}{lrl}
            \toprule
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   "test_to_latex_no_header_with_indexz4TestToLatexHeader.test_to_latex_no_header_with_index+  s_    aV4,7788E**

 

 !!!!!!r   c                     t          ddgddgd          }|                    dd          }t          d          }||k    sJ d S )	Nr   r   r   r   r   F)r=   r   z
            \begin{tabular}{rl}
            \toprule
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   %test_to_latex_no_header_without_indexz7TestToLatexHeader.test_to_latex_no_header_without_index<  sa    aV4,7788577

 

 !!!!!!r   c                     t          ddgddgd          }|                    ddg          }t          d	          }||k    sJ d S )
Nr   r   r   r   r   AABBr   z
            \begin{tabular}{lrl}
            \toprule
             & AA & BB \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   )test_to_latex_specified_header_with_indexz;TestToLatexHeader.test_to_latex_specified_header_with_indexM  sc    aV4,7788T4L11	
 
 !!!!!!r   c                     t          ddgddgd          }|                    ddgd	          }t          d
          }||k    sJ d S )Nr   r   r   r   r   r   r   F)r   r=   z
            \begin{tabular}{rl}
            \toprule
            AA & BB \\
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   ,test_to_latex_specified_header_without_indexz>TestToLatexHeader.test_to_latex_specified_header_without_index_  se    aV4,7788T4L>>	
 
 !!!!!!r   zheader, num_aliasesAr   ))Br   ))Col1Col2Col3r   ))r   r   r   Col4r   c                     t          ddgddgd          }d| d}t          j        t          |          5  |                    |	           d d d            d S # 1 swxY w Y   d S )
Nr   r   r   r   r   zWriting 2 cols but got z aliasesrD   r   rH   )r%   r   num_aliasesr0   rL   s        r   8test_to_latex_number_of_items_in_header_missmatch_raiseszJTestToLatexHeader.test_to_latex_number_of_items_in_header_missmatch_raisesq  s     aV4,7788====]:S111 	' 	'KKvK&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's   AA #A c                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	N      ?g @r   r   r   ,)decimalz
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1,000000 & b1 \\
            1 & 2,100000 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   test_to_latex_decimalz'TestToLatexHeader.test_to_latex_decimal  s_    c3ZtTl;;<<S))	
 
 !!!!!!r   N)rp   rq   rr   r   r   r   r   rI   rs   rt   r   r   r   r   r   r   r   *  s        " " """ " """ " "$" " "$ [UAJ)1		
 	' 	' 	'" " " " "r   r   c                       e Zd Zd Zd ZdS )TestToLatexBoldc                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   T	bold_rowsz
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            \textbf{0} & 1 & b1 \\
            \textbf{1} & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   test_to_latex_bold_rowsz'TestToLatexBold.test_to_latex_bold_rows  s_    aV4,7788t,,	
 
 !!!!!!r   c                     t          ddgddgd          }|                    d          }t          d          }||k    sJ d S )	Nr   r   r   r   r   Fr   r5   r6   r7   s       r   test_to_latex_no_bold_rowsz*TestToLatexBold.test_to_latex_no_bold_rows  s_    aV4,7788u--	
 
 !!!!!!r   N)rp   rq   rr   r   r   r   r   r   r   r     s2        " " "$" " " " "r   r   c                   <   e Zd Zej        d             Zej        d             Zej        d             Zej        d             Zej        d             Z	d Z
d Zd Zd	 Zd
 Zd Zej                            dg d          d             Zd Zd Zd Zd Zd ZdS )TestToLatexCaptionLabelc                     dS )z,Caption for table/tabular LaTeX environment.z/a table in a \texttt{table/tabular} environmentr   r%   s    r   caption_tablez%TestToLatexCaptionLabel.caption_table  s     BAr   c                     dS )z@Short caption for testing \caption[short_caption]{full_caption}.za tabler   r   s    r   short_captionz%TestToLatexCaptionLabel.short_caption  s	     yr   c                     dS )z*Label for table/tabular LaTeX environment.ztab:table_tabularr   r   s    r   label_tablez#TestToLatexCaptionLabel.label_table  s
     #"r   c                     dS )z(Caption for longtable LaTeX environment.z+a table in a \texttt{longtable} environmentr   r   s    r   caption_longtablez)TestToLatexCaptionLabel.caption_longtable  s
     >=r   c                     dS )z&Label for longtable LaTeX environment.ztab:longtabler   r   s    r   label_longtablez'TestToLatexCaptionLabel.label_longtable  s	     r   c                 `    |                     |          }t          d          }||k    sJ d S )NcaptionaN  
            \begin{table}
            \caption{a table in a \texttt{table/tabular} environment}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r"   r   )r%   r   r   r8   r9   s        r   test_to_latex_caption_onlyz2TestToLatexCaptionLabel.test_to_latex_caption_only  sE    ""="99
 
 !!!!!!r   c                 `    |                     |          }t          d          }||k    sJ d S )N)labela.  
            \begin{table}
            \label{tab:table_tabular}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r   )r%   r   r   r8   r9   s        r   test_to_latex_label_onlyz0TestToLatexCaptionLabel.test_to_latex_label_only  sE    """55
 
 !!!!!!r   c                 b    |                     ||          }t          d          }||k    sJ d S )Nr   r   at  
            \begin{table}
            \caption{a table in a \texttt{table/tabular} environment}
            \label{tab:table_tabular}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r   )r%   r   r   r   r8   r9   s         r   test_to_latex_caption_and_labelz7TestToLatexCaptionLabel.test_to_latex_caption_and_label   sG    ""="LL
 
  !!!!!!r   c                 d    |                     ||f          }t          d          }||k    sJ d S )Nr   aW  
            \begin{table}
            \caption[a table]{a table in a \texttt{table/tabular} environment}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r   )r%   r   r   r   r8   r9   s         r   &test_to_latex_caption_and_shortcaptionz>TestToLatexCaptionLabel.test_to_latex_caption_and_shortcaption  sL     ""M=+I"JJ
 
 !!!!!!r   c                     d}|                     |          }|                     t          |                    }||k    sJ d S )N)zLong-long-captionShortr   )r"   list)r%   r   r   result_tupleresult_lists        r   1test_to_latex_caption_and_shortcaption_list_is_okzITestToLatexCaptionLabel.test_to_latex_caption_and_shortcaption_list_is_ok-  sP    0(((99''W'>>{******r   c                 f    |                     ||f|          }t          d          }||k    sJ d S )Nr   a}  
            \begin{table}
            \caption[a table]{a table in a \texttt{table/tabular} environment}
            \label{tab:table_tabular}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r   )r%   r   r   r   r   r8   r9   s          r   ,test_to_latex_caption_shortcaption_and_labelzDTestToLatexCaptionLabel.test_to_latex_caption_shortcaption_and_label3  sX     """M2 # 
 
 
 
  !!!!!!r   bad_caption))full_captionr   extra_string)r   r   r   )r   r   N)r   )Nc                     t          ddgi          }d}t          j        t          |          5  |                    |           d d d            d S # 1 swxY w Y   d S )Nr   r   z7`caption` must be either a string or 2-tuple of stringsrD   r   rH   )r%   r   r0   rL   s       r    test_to_latex_bad_caption_raisesz8TestToLatexCaptionLabel.test_to_latex_bad_caption_raisesQ  s     aSz""G]:S111 	- 	-KKK,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s   AAAc                 `    |                     d          }t          d          }||k    sJ d S )Nxyr   a!  
            \begin{table}
            \caption{xy}
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r   )r%   r   r8   r9   s       r   test_to_latex_two_chars_captionz7TestToLatexCaptionLabel.test_to_latex_two_chars_captionb  sG     ""4"00
 
 !!!!!!r   c                 b    |                     d|          }t          d          }||k    sJ d S )NT)ry   r   ai  
            \begin{longtable}{lrl}
            \caption{a table in a \texttt{longtable} environment} \\
            \toprule
             & a & b \\
            \midrule
            \endfirsthead
            \caption[]{a table in a \texttt{longtable} environment} \\
            \toprule
             & a & b \\
            \midrule
            \endhead
            \midrule
            \multicolumn{3}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \end{longtable}
            r   )r%   r   r   r8   r9   s        r   $test_to_latex_longtable_caption_onlyz<TestToLatexCaptionLabel.test_to_latex_longtable_caption_onlyw  sJ     ""T;L"MM
 
0 !!!!!!r   c                 b    |                     d|          }t          d          }||k    sJ d S )NT)ry   r   a  
            \begin{longtable}{lrl}
            \label{tab:longtable} \\
            \toprule
             & a & b \\
            \midrule
            \endfirsthead
            \toprule
             & a & b \\
            \midrule
            \endhead
            \midrule
            \multicolumn{3}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \end{longtable}
            r   )r%   r   r   r8   r9   s        r   "test_to_latex_longtable_label_onlyz:TestToLatexCaptionLabel.test_to_latex_longtable_label_only  sG    ""T"II
 
. !!!!!!r   c                 d    |                     d||          }t          d          }||k    sJ d S )NTry   r   r   a+  
        \begin{longtable}{lrl}
        \caption{a table in a \texttt{longtable} environment} \label{tab:longtable} \\
        \toprule
         & a & b \\
        \midrule
        \endfirsthead
        \caption[]{a table in a \texttt{longtable} environment} \\
        \toprule
         & a & b \\
        \midrule
        \endhead
        \midrule
        \multicolumn{3}{r}{Continued on next page} \\
        \midrule
        \endfoot
        \bottomrule
        \endlastfoot
        0 & 1 & b1 \\
        1 & 2 & b2 \\
        \end{longtable}
        r   )r%   r   r   r   r8   r9   s         r   )test_to_latex_longtable_caption_and_labelzATestToLatexCaptionLabel.test_to_latex_longtable_caption_and_label  sV     ""%! # 
 

 
 
0 !!!!!!r   c                 h    |                     d||f|          }t          d          }||k    sJ d S )NTr   a  
\begin{longtable}{lrl}
\caption[a table]{a table in a \texttt{longtable} environment} \label{tab:longtable} \\
\toprule
 & a & b \\
\midrule
\endfirsthead
\caption[]{a table in a \texttt{longtable} environment} \\
\toprule
 & a & b \\
\midrule
\endhead
\midrule
\multicolumn{3}{r}{Continued on next page} \\
\midrule
\endfoot
\bottomrule
\endlastfoot
0 & 1 & b1 \\
1 & 2 & b2 \\
\end{longtable}
r   )r%   r   r   r   r   r8   r9   s          r   6test_to_latex_longtable_caption_shortcaption_and_labelzNTestToLatexCaptionLabel.test_to_latex_longtable_caption_shortcaption_and_label  s[     ""&6! # 
 

 
 
0 !!!!!!r   N)rp   rq   rr   rI   fixturer   r   r   r   r   r   r   r   r   r   r   rs   rt   r   r   r   r   r   r   r   r   r   r   r     s       ^B B ^B ^  ^ ^# # ^# ^> > ^> ^  ^" " "(" " "(" " "*" " "0+ + +" " "< [	
 	
 	
	 	- -	 	-" " "*" " ">" " "8$" $" $"L%" %" %" %" %"r   r   c                   L    e Zd Zej        d             Zd Zd Zd Zd Z	d Z
dS )TestToLatexEscapec              #   J   K   d}d}t          |d|di|d|did          V  dS )z=Dataframe with special characters for testing chars escaping.r   r   )zco$e^x$zco^l1Nr   )r%   r   r   s      r   df_with_symbolsz!TestToLatexEscape.df_with_symbols  sF       QQ$433?OPPQQQQQQQr   c                 `    |                     d          }t          d          }||k    sJ d S )NFescapez
            \begin{tabular}{lll}
            \toprule
             & co$e^x$ & co^l1 \\
            \midrule
            a & a & a \\
            b & b & b \\
            \bottomrule
            \end{tabular}
            r   )r%   r   r8   r9   s       r   test_to_latex_escape_falsez,TestToLatexEscape.test_to_latex_escape_false  sE     )))77	
 
 !!!!!!r   c                 j    |                                 }|                     d          }||k    sJ d S )NTr   rP   )r%   r   defaultspecified_trues       r   test_to_latex_escape_defaultz.TestToLatexEscape.test_to_latex_escape_default  s@    !**,,(111>>.((((((r   c                     t          g d          }|                    d          }t          d          }||k    sJ d S )N)za\b\cz^a^b^cz~a~b~cTr   ac  
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & a\textbackslash b\textbackslash c \\
            1 & \textasciicircum a\textasciicircum b\textasciicircum c \\
            2 & \textasciitilde a\textasciitilde b\textasciitilde c \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   test_to_latex_special_escapez.TestToLatexEscape.test_to_latex_special_escape  sV    77788D))

 
 !!!!!!r   c                     g d}t          |          }|                    d          }t          d          }||k    sJ d S )N)
&%$#_{r   ~^\)dataTr   a  
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & \& \\
            1 & \% \\
            2 & \$ \\
            3 & \# \\
            4 & \_ \\
            5 & \{ \\
            6 & \} \\
            7 & \textasciitilde  \\
            8 & \textasciicircum  \\
            9 & \textbackslash  \\
            \bottomrule
            \end{tabular}
            r6   )r%   special_charactersr0   r8   r9   s        r   "test_to_latex_escape_special_charsz4TestToLatexEscape.test_to_latex_escape_special_chars0  s_    PPP.///D))
 
( !!!!!!r   c                     t          ddgddgd          }|                    ddgd	          }t          d
          }||k    sJ d S )Nr   r   r   r   r   z$A$z$B$F)r   r   z
            \begin{tabular}{lrl}
            \toprule
             & $A$ & $B$ \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   ;test_to_latex_specified_header_special_chars_without_escapezMTestToLatexEscape.test_to_latex_specified_header_special_chars_without_escapeJ  se    aV4,7788UEN5AA	
 
 !!!!!!r   N)rp   rq   rr   rI   r   r   r   r   r   r   r   r   r   r   r   r      s}        ^R R ^R" " " ) ) )" " "$" " "4" " " " "r   r   c                       e Zd Zd Zd ZdS )TestToLatexPositionc                     d}t          ddgddgd          }|                    |          }t          d          }||k    sJ d S )	Nhr   r   r   r   r   )positiona  
            \begin{table}[h]
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r6   r%   the_positionr0   r8   r9   s        r   test_to_latex_positionz*TestToLatexPosition.test_to_latex_position^  sd    aV4,7788l33
 
 !!!!!!r   c                     d}t          ddgddgd          }|                    d|          }t          d	          }||k    sJ d S )
Ntr   r   r   r   r   T)ry   r   a  
            \begin{longtable}[t]{lrl}
            \toprule
             & a & b \\
            \midrule
            \endfirsthead
            \toprule
             & a & b \\
            \midrule
            \endhead
            \midrule
            \multicolumn{3}{r}{Continued on next page} \\
            \midrule
            \endfoot
            \bottomrule
            \endlastfoot
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \end{longtable}
            r6   r  s        r    test_to_latex_longtable_positionz4TestToLatexPosition.test_to_latex_longtable_positionr  sf    aV4,7788tlCC
 
, !!!!!!r   N)rp   rq   rr   r  r  r   r   r   r   r   ]  s2        " " "(" " " " "r   r   c                   l    e Zd Zd Zd Zd Zej                            dddg          d             Z	dS )	TestToLatexFormattersc           	      (   t          t          ddd          t          ddd          t          ddd          gg dg dg dd	          }d
 d d d d d}|                    t          |                    }t	          d          }||k    sJ d S )Ni  r   r   r@   r   )r          @      @r   r   r   ))r   r   TF)
datetime64floatintobjectc                 ,    |                      d          S )Nz%Y-%m)strftimexs    r   <lambda>zETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>  s    AJJw$7$7 r   c                     d| ddS )N[z 4.1f]r   r  s    r   r  zETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>  s    ~1~~~~ r   c                     d| dS )N0xr  r   r  s    r   r  zETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>  s    Z!ZZZ r   c                     d| dS )N-r   r  s    r   r  zETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>  s    
A


 r   c                     d|  S )Nzindex: r   r  s    r   r  zETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>  s    =Q== r   )r  r  r  r  	__index__)
formattersaq  
            \begin{tabular}{llrrl}
            \toprule
             & datetime64 & float & int & object \\
            \midrule
            index: 0 & 2016-01 & [ 1.0] & 0x1 & -(1, 2)- \\
            index: 1 & 2016-02 & [ 2.0] & 0x2 & -True- \\
            index: 2 & 2016-03 & [ 3.0] & 0x3 & -False- \\
            \bottomrule
            \end{tabular}
            )r   r   r"   dictr   )r%   r0   r  r8   r9   s        r   test_to_latex_with_formattersz3TestToLatexFormatters.test_to_latex_with_formatters  s     T1a((T1a((T1a((
 ) yy///	 	
 
 87--''**00
 

 Z(8(899

 
 !!!!!!r   c                     t          ddgi          }|                    d          }t          d          }||k    sJ d S )Nr  gvöE?z%.3frV   z
            \begin{tabular}{lr}
            \toprule
             & x \\
            \midrule
            0 & 0.200 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   3test_to_latex_float_format_no_fixed_width_3decimalszITestToLatexFormatters.test_to_latex_float_format_no_fixed_width_3decimals  sV    gY'((&11

 

 !!!!!!r   c                     t          ddgi          }|                    d          }t          d          }||k    sJ d S )Nr  g      Y@z%.0frV   z
            \begin{tabular}{lr}
            \toprule
             & x \\
            \midrule
            0 & 100 \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   1test_to_latex_float_format_no_fixed_width_integerzGTestToLatexFormatters.test_to_latex_float_format_no_fixed_width_integer  sU    eW~&&&11

 

 !!!!!!r   na_repNaNTedc                     t          ddgdd ggddg          }|                    |dj                  }t          d| d	          }||k    sJ d S )
Nr   g(\?GroupData)columnsz{:.2f})r&  rW   z
            \begin{tabular}{llr}
            \toprule
             & Group & Data \\
            \midrule
            0 & A & 1.22 \\
            1 & A & zB \\
            \bottomrule
            \end{tabular}
            )r   r"   rX   r   )r%   r&  r0   r8   r9   s        r   %test_to_latex_na_rep_and_float_formatz;TestToLatexFormatters.test_to_latex_na_rep_and_float_format  s    fd f%
 
 
 FII	 	 	 	
 
 !!!!!!r   N)
rp   rq   rr   r!  r#  r%  rI   rs   rt   r-  r   r   r   r  r    st        $" $" $"L" " """ " "" [Xu~66" " 76" " "r   r  c            	          e Zd Zej        d             Zej        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ej                            dddg          ej                            dddg          ej                            ddgdgddgg          d                                     Zej                            dddg          d             Zd Zd ZdS )TestToLatexMultiindexc              #     K   t          j        t          d t          d          D                       t          d t          d          D                       t          d t          d          D                       t          d t          d          D                       t          d t          d          D                       d          j        V  dS )	z7Multiindex dataframe for testing multirow LaTeX macros.c                     i | ]}||S r   r   .0r  s     r   
<dictcomp>z:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>      ":":":A1a":":":r   r   c                     i | ]}||d z   	S r   r   r2  s     r   r4  z:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>      ">">">1a!e">">">r   c                     i | ]}||S r   r   r2  s     r   r4  z:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>  r5  r   c                     i | ]}||d z   	S r7  r   r2  s     r   r4  z:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>  r8  r   c                     i | ]}||S r   r   r2  s     r   r4  z:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>  r5  r   )c1r   )r=  r   )c2r   )r>  r   )c3r   N)r   	from_dictr   rangeTr   s    r   multiindex_framez&TestToLatexMultiindex.multiindex_frame  s       !!":":q":":":;;!">">U1XX">">">??!":":q":":":;;!">">U1XX">">">??!":":q":":":;; 
 
 	 	 	 	 	r   c           
   #     K   t          d t          d          D             d t          d          D             d t          d          D             d t          d          D             d t          d          D             d          V  dS )	z;Multicolumn dataframe for testing multicolumn LaTeX macros.c                     i | ]}||S r   r   r2  s     r   r4  z;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>      333QAq333r   r@   c                     i | ]}||d z   	S r@   r   r2  s     r   r4  z;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>      777Aq1u777r   c                     i | ]}||S r   r   r2  s     r   r4  z;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>  rF  r   c                     i | ]}||d z   	S rH  r   r2  s     r   r4  z;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>  rI  r   c                     i | ]}||S r   r   r2  s     r   r4  z;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>  rF  r   r<  N)r   rA  r   s    r   multicolumn_framez'TestToLatexMultiindex.multicolumn_frame  s       33%((33377eAhh77733%((33377eAhh77733%((333 
 
 	
 	
 	
 	
 	
r   c                     t          dgdgdgdgd          }|                    ddg          }|                    dd	gd
          }t          d          }||k    sJ d S )Nr   r   r   r   )r   r   rB   dr   r   r1r2F)r   multirowz
            \begin{tabular}{llrr}
            \toprule
             &  & r1 & r2 \\
            a & b &  &  \\
            \midrule
            0 & 1 & 2 & 3 \\
            \bottomrule
            \end{tabular}
            r   	set_indexr"   r   )r%   r0   observedr9   s       r   test_to_latex_multindex_headerz4TestToLatexMultiindex.test_to_latex_multindex_header  s~    aSs!A3??@@\\3*%%;;tTlU;CC	
 
 8######r   c                     t           j                            ddggdg          }t          d|t	          d                    }|                                }t          d          }||k    sJ d S )	Nr   r    namesr   r=   r,  a  
            \begin{tabular}{lrrrr}
            \toprule
             & 0 & 1 & 2 & 3 \\
             &  &  &  &  \\
            \midrule
            1 & -1 & -1 & -1 & -1 \\
            2 & -1 & -1 & -1 & -1 \\
            \bottomrule
            \end{tabular}
            )pd
MultiIndexfrom_productr   rA  r"   r   )r%   mir0   rU  r9   s        r   #test_to_latex_multiindex_empty_namez9TestToLatexMultiindex.test_to_latex_multiindex_empty_name  sx    ]''!Q'==rU1XX666;;==

 
 8######r   c                     t          ddgi          }|                                }t          d          }||k    sJ d S )Nr  yr   z
            \begin{tabular}{ll}
            \toprule
             & x \\
             & y \\
            \midrule
            0 & a \\
            \bottomrule
            \end{tabular}
            r6   r7   s       r   'test_to_latex_multiindex_column_tabularz=TestToLatexMultiindex.test_to_latex_multiindex_column_tabular3  sP    
SE*++	
 
 !!!!!!r   c                     t          ddgi          j        }|                    d          }t          d          }||k    sJ d S )Nrc  r   FrR  z
            \begin{tabular}{lll}
            \toprule
             &  & 0 \\
            \midrule
            x & y & a \\
            \bottomrule
            \end{tabular}
            )r   rB  r"   r   r7   s       r   &test_to_latex_multiindex_small_tabularz<TestToLatexMultiindex.test_to_latex_multiindex_small_tabularD  sY    
SE*++-e,,

 

 !!!!!!r   c                 `    |                     d          }t          d          }||k    sJ d S )NFrg  aj  
            \begin{tabular}{llrrrr}
            \toprule
             &  & 0 & 1 & 2 & 3 \\
            \midrule
            c1 & 0 & 0 & 1 & 2 & 3 \\
             & 1 & 4 & 5 & 6 & 7 \\
            c2 & 0 & 0 & 1 & 2 & 3 \\
             & 1 & 4 & 5 & 6 & 7 \\
            c3 & 0 & 0 & 1 & 2 & 3 \\
            \bottomrule
            \end{tabular}
            r   )r%   rC  r8   r9   s       r    test_to_latex_multiindex_tabularz6TestToLatexMultiindex.test_to_latex_multiindex_tabularT  sE    !**E*::
 
 !!!!!!r   c                     |j         }ddg|j        _        |                    d          }t	          d          }||k    sJ d S )Nr   r   Frg  a  
            \begin{tabular}{lrrrrr}
            \toprule
            a & \multicolumn{2}{r}{c1} & \multicolumn{2}{r}{c2} & c3 \\
            b & 0 & 1 & 0 & 1 & 0 \\
            \midrule
            0 & 0 & 4 & 0 & 4 & 0 \\
            1 & 1 & 5 & 1 & 5 & 1 \\
            2 & 2 & 6 & 2 & 6 & 2 \\
            3 & 3 & 7 & 3 & 7 & 3 \\
            \bottomrule
            \end{tabular}
            )rB  r,  rZ  r"   r   )r%   rC  r0   r8   r9   s        r   !test_to_latex_multicolumn_tabularz7TestToLatexMultiindex.test_to_latex_multicolumn_tabularg  sX    :
e,,
 
 !!!!!!r   c                     t          g dt          d          g dd          }|                    ddg                              d          }t	          d	          }||k    sJ d S )
Nr   r   r   r   ababr   r   r   r   r^   r   r   Frg  a  
            \begin{tabular}{llr}
            \toprule
             &  & c \\
            a & b &  \\
            \midrule
            0 & a & 1 \\
             & b & 2 \\
            1 & a & 3 \\
             & b & 4 \\
            \bottomrule
            \end{tabular}
            )r   r   rT  r"   r   r7   s       r   $test_to_latex_index_has_name_tabularz:TestToLatexMultiindex.test_to_latex_index_has_name_tabular}  sz    \\\V<<<PPQQsCj))22E2BB
 
 !!!!!!r   c                     t          g dt          d          g dd          }|                    d                                                              dj        d          }t          d	          }||k    sJ d S )
Nrn  ro  rp  r^   r   z{:.1f}T)rW   r   a  
            \begin{tabular}{lrrrrrrrr}
            \toprule
             & \multicolumn{8}{r}{c} \\
             & count & mean & std & min & 25\% & 50\% & 75\% & max \\
            a &  &  &  &  &  &  &  &  \\
            \midrule
            0 & 2.0 & 1.5 & 0.7 & 1.0 & 1.2 & 1.5 & 1.8 & 2.0 \\
            1 & 2.0 & 3.5 & 0.7 & 3.0 & 3.2 & 3.5 & 3.8 & 4.0 \\
            \bottomrule
            \end{tabular}
            )r   r   groupbydescriber"   rX   r   r7   s       r   test_to_latex_groupby_tabularz3TestToLatexMultiindex.test_to_latex_groupby_tabular  s    \\\V<<<PPQQJJsOOXZZX8?4X@@ 	
 
 
 !!!!!!r   c                     t          t          j                            ddg          dg          }|                    d          }t          d          }||k    sJ d S )N)r   rB   )r   rB   colr\  Frg  z
            \begin{tabular}{lll}
            \toprule
             &  & col \\
            \midrule
            A & c & NaN \\
            B & c & NaN \\
            \bottomrule
            \end{tabular}
            )r   r]  r^  from_tuplesr"   r   r7   s       r   #test_to_latex_multiindex_dupe_levelz9TestToLatexMultiindex.test_to_latex_multiindex_dupe_level  sw     -++Z,DEEPUw
 
 
 e,,	
 
 !!!!!!r   c                 \    |                                 }t          d          }||k    sJ d S )Na  
            \begin{tabular}{lrrrrr}
            \toprule
             & \multicolumn{2}{r}{c1} & \multicolumn{2}{r}{c2} & c3 \\
             & 0 & 1 & 0 & 1 & 0 \\
            \midrule
            0 & 0 & 5 & 0 & 5 & 0 \\
            1 & 1 & 6 & 1 & 6 & 1 \\
            2 & 2 & 7 & 2 & 7 & 2 \\
            3 & 3 & 8 & 3 & 8 & 3 \\
            4 & 4 & 9 & 4 & 9 & 4 \\
            \bottomrule
            \end{tabular}
            r   r%   rM  r8   r9   s       r   !test_to_latex_multicolumn_defaultz7TestToLatexMultiindex.test_to_latex_multicolumn_default  s@    "++--
 
  !!!!!!r   c                 b    |                     dd          }t          d          }||k    sJ d S )NFrA   )multicolumnmulticolumn_formata  
            \begin{tabular}{lrrrrr}
            \toprule
             & c1 & & c2 & & c3 \\
             & 0 & 1 & 0 & 1 & 0 \\
            \midrule
            0 & 0 & 5 & 0 & 5 & 0 \\
            1 & 1 & 6 & 1 & 6 & 1 \\
            2 & 2 & 7 & 2 & 7 & 2 \\
            3 & 3 & 8 & 3 & 8 & 3 \\
            4 & 4 & 9 & 4 & 9 & 4 \\
            \bottomrule
            \end{tabular}
            r   r{  s       r   test_to_latex_multicolumn_falsez5TestToLatexMultiindex.test_to_latex_multicolumn_false  sH    "++RU+VV
 
  !!!!!!r   c                 j    |j                             d          }t          d          }||k    sJ d S )NTrg  a  
            \begin{tabular}{llrrrrr}
            \toprule
             &  & 0 & 1 & 2 & 3 & 4 \\
            \midrule
            \multirow[t]{2}{*}{c1} & 0 & 0 & 1 & 2 & 3 & 4 \\
             & 1 & 5 & 6 & 7 & 8 & 9 \\
            \cline{1-7}
            \multirow[t]{2}{*}{c2} & 0 & 0 & 1 & 2 & 3 & 4 \\
             & 1 & 5 & 6 & 7 & 8 & 9 \\
            \cline{1-7}
            c3 & 0 & 0 & 1 & 2 & 3 & 4 \\
            \cline{1-7}
            \bottomrule
            \end{tabular}
            )rB  r"   r   r{  s       r   test_to_latex_multirow_truez1TestToLatexMultiindex.test_to_latex_multirow_true  sH    "$--t-<<
 
$ !!!!!!r   c                     |j         j        |_        |j                             ddd          }t          d          }||k    sJ d S )NTrB   )rR  r~  r  a=  
            \begin{tabular}{llrrrrr}
            \toprule
             &  & \multicolumn{2}{c}{c1} & \multicolumn{2}{c}{c2} & c3 \\
             &  & 0 & 1 & 0 & 1 & 0 \\
            \midrule
            \multirow[t]{2}{*}{c1} & 0 & 0 & 1 & 2 & 3 & 4 \\
             & 1 & 5 & 6 & 7 & 8 & 9 \\
            \cline{1-7}
            \multirow[t]{2}{*}{c2} & 0 & 0 & 1 & 2 & 3 & 4 \\
             & 1 & 5 & 6 & 7 & 8 & 9 \\
            \cline{1-7}
            c3 & 0 & 0 & 1 & 2 & 3 & 4 \\
            \cline{1-7}
            \bottomrule
            \end{tabular}
            )rB  r=   r"   r   r{  s       r   1test_to_latex_multicolumnrow_with_multicol_formatzGTestToLatexMultiindex.test_to_latex_multicolumnrow_with_multicol_format  sf    "3"5";"$--" . 
 

 
 
& !!!!!!r   name0Nnamed0name1named1axesr   r   c                    ||g}t           j                            ddgddgg          }t          d|                                |                                          }D ]}||j        |         _        t          d |D                       }dv r#t          |          r|d          d	|d          d
nd}	fd|D             }
|	                    d          }dt          t          |
          |	gz             z  }||k    sJ d S )Nr   r   r   r   r[  r\  c              3      K   | ]}|pd V  	dS )rX  Nr   )r3  ns     r   	<genexpr>zGTestToLatexMultiindex.test_to_latex_multiindex_names.<locals>.<genexpr>)  s&      11a!'r111111r   r   z & z &  &  &  &  \\
rX  c                 >    g | ]}t          |          rd v r|ndS )r   rX  )bool)r3  r  r  s     r   
<listcomp>zHTestToLatexMultiindex.test_to_latex_multiindex_names.<locals>.<listcomp>/  s1    IIIa4779qDy9QQrIIIr   Frg  a
  \begin{tabular}{llrrrr}
\toprule
 & %s & \multicolumn{2}{r}{1} & \multicolumn{2}{r}{2} \\
 & %s & 3 & 4 & 3 & 4 \\
%s\midrule
1 & 3 & -1 & -1 & -1 & -1 \\
 & 4 & -1 & -1 & -1 & -1 \\
2 & 3 & -1 & -1 & -1 & -1 \\
 & 4 & -1 & -1 & -1 & -1 \\
\bottomrule
\end{tabular}
)r]  r^  r_  r   copyr  rZ  tupleanyr"   r   )r%   r  r  r  rZ  r`  r0   idx	idx_namesidx_names_row	col_namesrU  r9   s      `         r   test_to_latex_multiindex_namesz4TestToLatexMultiindex.test_to_latex_multiindex_names  sE   
 ]''!Q!Q(899rBGGII>>> 	' 	'C!&BGCL11511111	 T	!%jjy|AA	!AAAA 	
 JIII5III	;;;.. OO}o-
 

 8######r   one_rowTFc                     t          d dgddgddgd          }|r|j        dg         }|                    dd	g                              d
          }t	          d          }|s|dz  }|dz  }||k    sJ d S )Nr   r   r   r   r@   r^   r   r   r   Frg  z
            \begin{tabular}{llr}
            \toprule
             &  & c \\
            a & b &  \\
            \midrule
            NaN & 2 & 4 \\
            z1.000000 & 3 & 5 \\
z\bottomrule
\end{tabular}
)r   ilocrT  r"   r   )r%   r  r0   rU  r9   s        r   test_to_latex_multiindex_nansz3TestToLatexMultiindex.test_to_latex_multiindex_nansB  s     dAYaV1a&AABB 	!B<<c
++44e4DD	
 	
  	  H  	 8######r   c                     t          g dgdz                                ddg          }|                    d          }t          d          }||k    sJ d S )Nr  r   r   r   Frg  z
            \begin{tabular}{llr}
            \toprule
             &  & 2 \\
            0 & 1 &  \\
            \midrule
            1 & 2 & 3 \\
             & 2 & 3 \\
            \bottomrule
            \end{tabular}
            rS  r7   s       r   test_to_latex_non_string_indexz4TestToLatexMultiindex.test_to_latex_non_string_index[  sk    			{Q''111a&99e,,

 
 !!!!!!r   c                     t           j                            ddgg dddggg d          }t          |          }|                    d	d
          }t          d          }||k    sJ d S )Ng        r   )r  r
  r   01)ival0val1rY  r<   TF)rR  r   aE  
            \begin{tabular}{lll}
            \toprule
            i & val0 & val1 \\
            \midrule
            \multirow[t]{6}{*}{0.000000} & \multirow[t]{2}{*}{3.000000} & 0 \\
             &  & 1 \\
            \cline{2-3}
             & \multirow[t]{2}{*}{2.000000} & 0 \\
             &  & 1 \\
            \cline{2-3}
             & \multirow[t]{2}{*}{1.000000} & 0 \\
             &  & 1 \\
            \cline{1-3} \cline{2-3}
            \multirow[t]{6}{*}{1.000000} & \multirow[t]{2}{*}{3.000000} & 0 \\
             &  & 1 \\
            \cline{2-3}
             & \multirow[t]{2}{*}{2.000000} & 0 \\
             &  & 1 \\
            \cline{2-3}
             & \multirow[t]{2}{*}{1.000000} & 0 \\
             &  & 1 \\
            \cline{1-3} \cline{2-3}
            \bottomrule
            \end{tabular}
            )r]  r^  r_  r   r"   r   )r%   r`  r0   r8   r9   s        r   !test_to_latex_multiindex_multirowz7TestToLatexMultiindex.test_to_latex_multiindex_multirown  s    ]''3Z3*5=R=R=R ( 
 
 R   d599
 
8 !!!!!!r   )rp   rq   rr   rI   r   rC  rM  rV  ra  re  rh  rj  rl  rq  ru  ry  r|  r  r  r  rs   rt   r  r  r  r  r   r   r   r/  r/    s       ^
 
 ^
 ^

 

 ^

$ $ $&$ $ $(" " """ " " " " "&" " "," " "*" " "0" " "4" " "(" " "(" " "," " "8 [WtX&677[WtX&677[VqcA3A%788$ $ 98 87 87$B [Yu66$ $ 76$0" " "&#" #" #" #" #"r   r/  )r.   r   textwrapr   rI   pandasr]  r   r   pandas._testing_testingr    importorskipr   r   r   r   rv   r   r   r   r   r   r  r/  r   r   r   <module>r     sv                                   H   # # # 7 7 7
k$ k$ k$ k$ k$ k$ k$ k$\X? X? X? X? X? X? X? X?vk" k" k" k" k" k" k" k"\#" #" #" #" #" #" #" #"L" " " " " " " "D
Z" Z" Z" Z" Z" Z" Z" Z"z/" /" /" /" /" /" /" /"d_" _" _" _" _" _" _" _"D`" `" `" `" `" `" `" `" `" `"r   