1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
U
­ý°d4³ã@s.ddlZddlmZddlmZddlZddlZddlmZmZddl    m
Z ddl m Z ddlmZmZmZmZe d¡dd    „Zejd
d „ƒZGd d „d ƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZ Gd d!„d!ƒZ!dS)"éN)Údatetime)Údedent)Ú    DataFrameÚSeries)ÚDataFrameFormatter)ÚRegularTableBuilderÚRowBodyIteratorÚRowHeaderIteratorÚRowStringConverterZjinja2cCs t|ƒ ¡S)zçDedent 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)Ústring©r ú\d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/io/formats/test_to_latex.pyÚ_dedentsrcCstddgddgdœƒS)z>Short dataframe for testing table/tabular/longtable LaTeX env.ééÚb1Úb2©ÚaÚb©rr r r rÚdf_short#src @s–eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zej     
d d d ddgddddhdddœg¡dd„ƒZ dd„Z dd„Z dd„Zdd„Zdd„Zdd „Zd!S)"Ú TestToLatexc
CsLt d¡8}| |¡t|ƒ}| ¡| ¡ks4t‚W5QRXW5QRXdS)Nútest.tex)ÚtmÚ ensure_cleanÚto_latexÚopenÚreadÚAssertionError)ÚselfÚ float_frameÚpathÚfr r rÚtest_to_latex_to_file*s 
 
z!TestToLatex.test_to_latex_to_filec
Csdtdggƒ}t d¡D}|j|ddtj|ddd}| ¡| ¡ksLt‚W5QRXW5QRXdS)Nõ
außgangenrúutf-8©ÚencodingÚr©rrrrÚcodecsrrr ©r!Údfr#r$r r rÚ(test_to_latex_to_file_utf8_with_encoding0s
  z4TestToLatex.test_to_latex_to_file_utf8_with_encodingc
Cs`tdggƒ}t d¡@}| |¡tj|ddd}| ¡| ¡ksHt‚W5QRXW5QRXdS)Nr&rr*r'r(r+r-r r rÚ+test_to_latex_to_file_utf8_without_encoding8s
 
z7TestToLatex.test_to_latex_to_file_utf8_without_encodingcCs6tddgddgdœƒ}| ¡}tdƒ}||ks2t‚dS)NrrrrrúÖ
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            ©rrrr ©r!r.ÚresultÚexpectedr r rÚ test_to_latex_tabular_with_index@s ÿ z,TestToLatex.test_to_latex_tabular_with_indexcCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrF©ÚindexzÊ
            \begin{tabular}{rl}
            \toprule
            a & b \\
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ#test_to_latex_tabular_without_indexQs  ÿ z/TestToLatex.test_to_latex_tabular_without_indexÚbad_column_formatég333333ó?Úlr*)r*Úcr=rc    CsDtddgddgdœƒ}d}tjt|d|j|dW5QRXdS)    Nrrrrrz&`column_format` must be str or unicode©Úmatch©Z column_format©rÚpytestÚraisesÚ
ValueErrorr)r!r:r.Úmsgr r rÚtest_to_latex_bad_column_formatbsz+TestToLatex.test_to_latex_bad_column_formatcCs|jdddS)NÚlcrr@)r)r!r"r r rÚ&test_to_latex_column_format_just_workslsz2TestToLatex.test_to_latex_column_format_just_workscCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrrGr@zÖ
            \begin{tabular}{lcr}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚtest_to_latex_column_formatps  ÿ z'TestToLatex.test_to_latex_column_formatcCs2tddgƒ}|jdjd}tdƒ}||ks.t‚dS)Ng@@Útestz{:,.0f}©Ú float_formatzÎ
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & 1,000 \\
            1 & test \\
            \bottomrule
            \end{tabular}
            )rrÚformatrr )r!Zserr4r5r r rÚ%test_to_latex_float_format_object_cols  ÿ z1TestToLatex.test_to_latex_float_format_object_colcCs&tƒ}| ¡}tdƒ}||ks"t‚dS)Nzˆ
            \begin{tabular}{l}
            \toprule
            \midrule
            \bottomrule
            \end{tabular}
            r2r3r r rÚtest_to_latex_empty_tabular“s ÿ    z'TestToLatex.test_to_latex_empty_tabularcCs.tdddgƒ}| ¡}tdƒ}||ks*t‚dS)Nrrr=zÜ
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & a \\
            1 & b \\
            2 & c \\
            \bottomrule
            \end{tabular}
            )rrrr )r!Úsr4r5r r rÚtest_to_latex_series¡s ÿ z TestToLatex.test_to_latex_seriescCs<tdddgiƒ}d|j_|jdd}tdƒ}||ks8t‚dS)NrrrZfooF)Z index_nameszÇ
            \begin{tabular}{lr}
            \toprule
             & a \\
            \midrule
            0 & 1 \\
            1 & 2 \\
            \bottomrule
            \end{tabular}
            )rr8Únamerrr r3r r rÚtest_to_latex_midrule_location³s ÿ z*TestToLatex.test_to_latex_midrule_locationN)Ú__name__Ú
__module__Ú __qualname__r%r/r0r6r9rBÚmarkÚ parametrizerFrHrIrNrOrQrSr r r rr)s þ
rc
@s‚eZdZdd„Zdd„Zdd„Zej de    dd    d
giƒd    fe    d    d
gd d gd œƒd
fe    d    d
gd d gddgdœƒd fg¡dd„ƒZ
dS)ÚTestToLatexLongtablecCs*tƒ}|jdd}tdƒ}||ks&t‚dS)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}
            r2r3r r rÚtest_to_latex_empty_longtableÈs  ÿz2TestToLatexLongtable.test_to_latex_empty_longtablecCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrTrZaÝ
            \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}
            r2r3r r rÚ"test_to_latex_longtable_with_indexßs  ÿz7TestToLatexLongtable.test_to_latex_longtable_with_indexcCs<tddgddgdœƒ}|jddd}td    ƒ}||ks8t‚dS)
NrrrrrFT©r8r[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}
            r2r3r r rÚ%test_to_latex_longtable_without_indexús ÿz:TestToLatexLongtable.test_to_latex_longtable_without_indexzdf, expected_numberrrréérr;é©rrr=cCs&|jddd}d|›d|ks"t‚dS)NFTr^z \multicolumn{Ú}©rr )r!r.Zexpected_numberr4r r rÚ.test_to_latex_longtable_continued_on_next_pages    zCTestToLatexLongtable.test_to_latex_longtable_continued_on_next_pageN) rTrUrVr\r]r_rBrWrXrrfr r r rrYÇsýþrYc@sXeZdZdd„Zdd„Zdd„Zdd„Zej     d    d
gd fd d dg¡dd„ƒZ
dd„Z dS)ÚTestToLatexHeadercCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrF©Úheaderz¾
            \begin{tabular}{lrl}
            \toprule
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ"test_to_latex_no_header_with_index#s  ÿ z4TestToLatexHeader.test_to_latex_no_header_with_indexcCs<tddgddgdœƒ}|jddd}tdƒ}||ks8t‚dS)    NrrrrrF)r8rizµ
            \begin{tabular}{rl}
            \toprule
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ%test_to_latex_no_header_without_index4s ÿ z7TestToLatexHeader.test_to_latex_no_header_without_indexcCs>tddgddgdœƒ}|jddgd}td    ƒ}||ks:t‚dS)
NrrrrrÚAAÚBBrhzØ
            \begin{tabular}{lrl}
            \toprule
             & AA & BB \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ)test_to_latex_specified_header_with_indexEs ÿ z;TestToLatexHeader.test_to_latex_specified_header_with_indexcCs@tddgddgdœƒ}|jddgdd    }td
ƒ}||ks<t‚dS) NrrrrrrlrmF)rir8zÌ
            \begin{tabular}{rl}
            \toprule
            AA & BB \\
            \midrule
            1 & b1 \\
            2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ,test_to_latex_specified_header_without_indexWs ÿ z>TestToLatexHeader.test_to_latex_specified_header_without_indexzheader, num_aliasesÚAr))ÚBr))ÚCol1ÚCol2ÚCol3r`))rrrsrtZCol4rac    CsLtddgddgdœƒ}d|›d}tjt|d|j|d    W5QRXdS)
NrrrrrzWriting 2 cols but got z aliasesr>rhrA)r!riZ num_aliasesr.rEr r rÚ8test_to_latex_number_of_items_in_header_missmatch_raisesis zJTestToLatexHeader.test_to_latex_number_of_items_in_header_missmatch_raisescCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    Nçð?gÍÌÌÌÌÌ@rrrú,)Údecimalzä
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1,000000 & b1 \\
            1 & 2,100000 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚtest_to_latex_decimal}s  ÿ z'TestToLatexHeader.test_to_latex_decimalN) rTrUrVrjrkrnrorBrWrXruryr r r rrg"süþ    
rgc@seZdZdd„Zdd„ZdS)ÚTestToLatexBoldcCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrT©Z    bold_rowszè
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            \textbf{0} & 1 & b1 \\
            \textbf{1} & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚtest_to_latex_bold_rows‘s  ÿ z'TestToLatexBold.test_to_latex_bold_rowscCs:tddgddgdœƒ}|jdd}tdƒ}||ks6t‚dS)    NrrrrrFr{r1r2r3r r rÚtest_to_latex_no_bold_rows£s  ÿ z*TestToLatexBold.test_to_latex_no_bold_rowsN)rTrUrVr|r}r r r rrzsrzc@sÊeZdZejdd„ƒZejdd„ƒZejdd„ƒZejdd„ƒZejd    d
„ƒZ    d d „Z
d d„Z dd„Z dd„Z dd„Zdd„Zej ddddddg¡dd„ƒZdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)S)*ÚTestToLatexCaptionLabelcCsdS)z,Caption for table/tabular LaTeX environment.z/a table in a \texttt{table/tabular} environmentr ©r!r r rÚ caption_table·sz%TestToLatexCaptionLabel.caption_tablecCsdS)z@Short caption for testing \caption[short_caption]{full_caption}.za tabler rr r rÚ short_caption¼sz%TestToLatexCaptionLabel.short_captioncCsdS)z*Label for table/tabular LaTeX environment.ztab:table_tabularr rr r rÚ label_tableÁsz#TestToLatexCaptionLabel.label_tablecCsdS)z(Caption for longtable LaTeX environment.z+a table in a \texttt{longtable} environmentr rr r rÚcaption_longtableÆsz)TestToLatexCaptionLabel.caption_longtablecCsdS)z&Label for longtable LaTeX environment.z tab:longtabler rr r rÚlabel_longtableËsz'TestToLatexCaptionLabel.label_longtablecCs$|j|d}tdƒ}||ks t‚dS)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}
            ©rrr )r!rr€r4r5r r rÚtest_to_latex_caption_onlyÐs
 ÿz2TestToLatexCaptionLabel.test_to_latex_caption_onlycCs$|j|d}tdƒ}||ks t‚dS)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!rr‚r4r5r r rÚtest_to_latex_label_onlyäs
 ÿz0TestToLatexCaptionLabel.test_to_latex_label_onlycCs&|j||d}tdƒ}||ks"t‚dS)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!rr€r‚r4r5r r rÚtest_to_latex_caption_and_labeløs
ÿz7TestToLatexCaptionLabel.test_to_latex_caption_and_labelcCs(|j||fd}tdƒ}||ks$t‚dS)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!rr€rr4r5r r rÚ&test_to_latex_caption_and_shortcaption s
ÿz>TestToLatexCaptionLabel.test_to_latex_caption_and_shortcaptioncCs0d}|j|d}|jt|ƒd}||ks,t‚dS)N)zLong-long-captionZShortr…)rÚlistr )r!rr†Z result_tupleZ result_listr r rÚ1test_to_latex_caption_and_shortcaption_list_is_ok%s zITestToLatexCaptionLabel.test_to_latex_caption_and_shortcaption_list_is_okcCs*|j||f|d}tdƒ}||ks&t‚dS)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!rr€rr‚r4r5r r rÚ,test_to_latex_caption_shortcaption_and_label+sþÿzDTestToLatexCaptionLabel.test_to_latex_caption_shortcaption_and_labelÚ bad_caption)Ú full_captionrZ extra_string)r’rr)r’rN)r’)Nc    Cs<tddgiƒ}d}tjt|d|j|dW5QRXdS)Nrrz7`caption` must be either a string or 2-tuple of stringsr>r…rA)r!r‘r.rEr r rÚ test_to_latex_bad_caption_raisesIs z8TestToLatexCaptionLabel.test_to_latex_bad_caption_raisescCs$|jdd}tdƒ}||ks t‚dS)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!rr4r5r r rÚtest_to_latex_two_chars_captionZs
 ÿz7TestToLatexCaptionLabel.test_to_latex_two_chars_captioncCs&|jd|d}tdƒ}||ks"t‚dS)NT)r[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!rrƒr4r5r r rÚ$test_to_latex_longtable_caption_onlyos
ÿz<TestToLatexCaptionLabel.test_to_latex_longtable_caption_onlycCs&|jd|d}tdƒ}||ks"t‚dS)NT)r[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!rr„r4r5r r rÚ"test_to_latex_longtable_label_onlyŽs
ÿz:TestToLatexCaptionLabel.test_to_latex_longtable_label_onlycCs(|jd||d}tdƒ}||ks$t‚dS)NT©r[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!rrƒr„r4r5r r rÚ)test_to_latex_longtable_caption_and_labelªsýÿzATestToLatexCaptionLabel.test_to_latex_longtable_caption_and_labelcCs,|jd||f|d}tdƒ}||ks(t‚dS)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!rrƒrr„r4r5r r rÚ6test_to_latex_longtable_caption_shortcaption_and_labelÐsýÿzNTestToLatexCaptionLabel.test_to_latex_longtable_caption_shortcaption_and_labelN)rTrUrVrBÚfixturer€rr‚rƒr„rˆrŠrŒrrrrWrXr“r•r–r—r™ršr r r rr~¶s>
 
 
 
 
ûþ
 
&r~c@sBeZdZejdd„ƒZdd„Zdd„Zdd„Zd    d
„Z    d d „Z
d S)ÚTestToLatexEscapeccs,d}d}t|d|di|d|didœƒVdS)z=Dataframe with special characters for testing chars escaping.rr)zco$e^x$zco^l1Nr)r!rrr r rÚdf_with_symbolsùsz!TestToLatexEscape.df_with_symbolscCs$|jdd}tdƒ}||ks t‚dS)NF©ÚescapezÞ
            \begin{tabular}{lll}
            \toprule
             & co$e^x$ & co^l1 \\
            \midrule
            a & a & a \\
            b & b & b \\
            \bottomrule
            \end{tabular}
            r‡)r!rr4r5r r rÚtest_to_latex_escape_falses
 ÿ z,TestToLatexEscape.test_to_latex_escape_falsecCs$| ¡}|jdd}||ks t‚dS)NTržre)r!rÚdefaultZspecified_truer r rÚtest_to_latex_escape_defaults z.TestToLatexEscape.test_to_latex_escape_defaultcCs2tdddgƒ}|jdd}tdƒ}||ks.t‚dS)Nza\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}
            r2r3r r rÚtest_to_latex_special_escapes  ÿ z.TestToLatexEscape.test_to_latex_special_escapec
CsFddddddddd    d
g
}t|d }|jd d }tdƒ}||ksBt‚dS)Nú&ú%ú$ú#Ú_Ú{rdú~ú^ú\)ÚdataTrža£
            \begin{tabular}{ll}
            \toprule
             & 0 \\
            \midrule
            0 & \& \\
            1 & \% \\
            2 & \$ \\
            3 & \# \\
            4 & \_ \\
            5 & \{ \\
            6 & \} \\
            7 & \textasciitilde  \\
            8 & \textasciicircum  \\
            9 & \textbackslash  \\
            \bottomrule
            \end{tabular}
            r2)r!Zspecial_charactersr.r4r5r r rÚ"test_to_latex_escape_special_chars(s
 ÿz4TestToLatexEscape.test_to_latex_escape_special_charscCs@tddgddgdœƒ}|jddgdd    }td
ƒ}||ks<t‚dS) Nrrrrrz$A$z$B$F)rirŸzÚ
            \begin{tabular}{lrl}
            \toprule
             & $A$ & $B$ \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ;test_to_latex_specified_header_special_chars_without_escapeBs ÿ zMTestToLatexEscape.test_to_latex_specified_header_special_chars_without_escapeN) rTrUrVrBr›rr r¢r£r®r¯r r r rrœøs
rœc@seZdZdd„Zdd„ZdS)ÚTestToLatexPositioncCs>d}tddgddgdœƒ}|j|d}tdƒ}||ks:t‚dS)    NÚhrrrrr)Úpositiona 
            \begin{table}[h]
            \begin{tabular}{lrl}
            \toprule
             & a & b \\
            \midrule
            0 & 1 & b1 \\
            1 & 2 & b2 \\
            \bottomrule
            \end{tabular}
            \end{table}
            r2©r!Z the_positionr.r4r5r r rÚtest_to_latex_positionVs ÿz*TestToLatexPosition.test_to_latex_positioncCs@d}tddgddgdœƒ}|jd|d}td    ƒ}||ks<t‚dS)
NÚtrrrrrT)r[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}
            r2r³r r rÚ test_to_latex_longtable_positionjsÿz4TestToLatexPosition.test_to_latex_longtable_positionN)rTrUrVr´r¶r r r rr°Usr°c@s>eZdZdd„Zdd„Zdd„Zej ddd    g¡d
d „ƒZ    d S) ÚTestToLatexFormatterscCsŽttdddƒtdddƒtdddƒgdddgdddgd    d
d gd œƒ}d d„dd„dd„dd„dd„dœ}|jt|ƒd}tdƒ}||ksŠt‚dS)Niàrrr;r`rvç@ç@)rrTF)Ú
datetime64ÚfloatÚintÚobjectcSs
| d¡S)Nz%Y-%m)Ústrftime©Úxr r rÚ<lambda>—ózETestToLatexFormatters.test_to_latex_with_formatters.<locals>.<lambda>cSsd|d›dS)Nú[z 4.1fú]r r¿r r rrÁ˜rÂcSs d|d›S)NÚ0xrÀr r¿r r rrÁ™rÂcSs d|›dS)Nú-r r¿r r rrÁšrÂcSs
d|›S)Nzindex: r r¿r r rrÁ›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}
            )rrrÚdictrr )r!r.rÈr4r5r r rÚtest_to_latex_with_formattersˆs*
 
 
ýøÿûÿ z3TestToLatexFormatters.test_to_latex_with_formatterscCs2tddgiƒ}|jdd}tdƒ}||ks.t‚dS)NrÀg vöE™É?z%.3frKz¶
            \begin{tabular}{lr}
            \toprule
             & x \\
            \midrule
            0 & 0.200 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ3test_to_latex_float_format_no_fixed_width_3decimals®s  ÿ zITestToLatexFormatters.test_to_latex_float_format_no_fixed_width_3decimalscCs2tddgiƒ}|jdd}tdƒ}||ks.t‚dS)NrÀgY@z%.0frKz´
            \begin{tabular}{lr}
            \toprule
             & x \\
            \midrule
            0 & 100 \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ1test_to_latex_float_format_no_fixed_width_integer¿s  ÿ zGTestToLatexFormatters.test_to_latex_float_format_no_fixed_width_integerÚna_repÚNaNZTedcCsLtddgddggddgd}|j|djd}td|›d    ƒ}||ksHt‚dS)
NrpgÂõ(\ó?ÚGroupÚData)Úcolumnsz{:.2f})rÍrLz›
            \begin{tabular}{llr}
            \toprule
             & Group & Data \\
            \midrule
            0 & A & 1.22 \\
            1 & A & zB \\
            \bottomrule
            \end{tabular}
            )rrrMrr )r!rÍr.r4r5r r rÚ%test_to_latex_na_rep_and_float_formatÐsþûúÿ z;TestToLatexFormatters.test_to_latex_na_rep_and_float_formatN)
rTrUrVrÊrËrÌrBrWrXrÒr r r rr·‡s
&r·c    @seZdZejdd„ƒZejdd„ƒZdd„Zdd„Zd    d
„Z    d d „Z
d d„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zej dd d!g¡ej d"d d#g¡ej d$d%gd&gd%d&gg¡d'd(„ƒƒƒZej d)d*d+g¡d,d-„ƒZd.d/„Zd0d1„Zd S)2ÚTestToLatexMultiindexc
csxt tdd„tdƒDƒƒtdd„tdƒDƒƒtdd„tdƒDƒƒtdd„tdƒDƒƒtdd„tdƒDƒƒdœ¡jVd    S)
z7Multiindex dataframe for testing multirow LaTeX macros.cSsi|]
}||“qSr r ©Ú.0rÀr r rÚ
<dictcomp>ïsz:TestToLatexMultiindex.multiindex_frame.<locals>.<dictcomp>racSsi|]}||d“qS©rar rÔr r rrÖðscSsi|]
}||“qSr r rÔr r rrÖñscSsi|]}||d“qSr×r rÔr r rrÖòscSsi|]
}||“qSr r rÔr r rrÖós©)Úc1r)rÙr)Úc2r)rÚr)Úc3rN)rÚ    from_dictrÚrangeÚTrr r rÚmultiindex_frameêsûÿz&TestToLatexMultiindex.multiindex_frameccs`tdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdœƒVd    S)
z;Multicolumn dataframe for testing multicolumn LaTeX macros.cSsi|]
}||“qSr r rÔr r rrÖüsz;TestToLatexMultiindex.multicolumn_frame.<locals>.<dictcomp>r;cSsi|]}||d“qS©r;r rÔr r rrÖýscSsi|]
}||“qSr r rÔr r rrÖþscSsi|]}||d“qSràr rÔr r rrÖÿscSsi|]
}||“qSr r rÔr r rrÖsrØN)rrÝrr r rÚmulticolumn_frame÷sûÿz'TestToLatexMultiindex.multicolumn_framecCsRtdgdgdgdgdœƒ}| ddg¡}|jdd    gd
d }td ƒ}||ksNt‚dS) Nrrrr`)rrr=ÚdrrZr1Zr2F)riÚmultirowzà
            \begin{tabular}{llrr}
            \toprule
             &  & r1 & r2 \\
            a & b &  &  \\
            \midrule
            0 & 1 & 2 & 3 \\
            \bottomrule
            \end{tabular}
            ©rÚ    set_indexrrr )r!r.Úobservedr5r r rÚtest_to_latex_multindex_headersÿ z4TestToLatexMultiindex.test_to_latex_multindex_headercCsJtjjddggdgd}td|tdƒd}| ¡}tdƒ}||ksFt‚dS)    NrrÚ©Únameséÿÿÿÿra©r8rÑ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_productrrÝrrr )r!Úmir.rær5r r rÚ#test_to_latex_multiindex_empty_namesÿ z9TestToLatexMultiindex.test_to_latex_multiindex_empty_namecCs.tddgiƒ}| ¡}tdƒ}||ks*t‚dS)N©rÀÚyrzÆ
            \begin{tabular}{ll}
            \toprule
             & x \\
             & y \\
            \midrule
            0 & a \\
            \bottomrule
            \end{tabular}
            r2r3r r rÚ'test_to_latex_multiindex_column_tabular+s ÿ z=TestToLatexMultiindex.test_to_latex_multiindex_column_tabularcCs4tddgiƒj}|jdd}tdƒ}||ks0t‚dS)NròrF©rãzº
            \begin{tabular}{lll}
            \toprule
             &  & 0 \\
            \midrule
            x & y & a \\
            \bottomrule
            \end{tabular}
            )rrÞrrr r3r r rÚ&test_to_latex_multiindex_small_tabular<s  ÿ z<TestToLatexMultiindex.test_to_latex_multiindex_small_tabularcCs$|jdd}tdƒ}||ks t‚dS)NFrõ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!rßr4r5r r rÚ test_to_latex_multiindex_tabularLs
 ÿz6TestToLatexMultiindex.test_to_latex_multiindex_tabularcCs6|j}ddg|j_|jdd}tdƒ}||ks2t‚dS)NrrFrõ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}
            )rÞrÑrêrrr )r!rßr.r4r5r r rÚ!test_to_latex_multicolumn_tabular_s  ÿz7TestToLatexMultiindex.test_to_latex_multicolumn_tabularcCsRtddddgtdƒddddgdœƒ}| dd    g¡jd
d }td ƒ}||ksNt‚dS) NrrÚababrr`rarcrrFrõa
            \begin{tabular}{llr}
            \toprule
             &  & c \\
            a & b &  \\
            \midrule
            0 & a & 1 \\
             & b & 2 \\
            1 & a & 3 \\
             & b & 4 \\
            \bottomrule
            \end{tabular}
            )rrŽrårrr r3r r rÚ$test_to_latex_index_has_name_tabularus $ÿz:TestToLatexMultiindex.test_to_latex_index_has_name_tabularcCsVtddddgtdƒddddgdœƒ}| d¡ ¡jd    jd
d }td ƒ}||ksRt‚dS) Nrrrùrr`rarcrz{:.1f}T)rLrŸ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}
            )rrŽÚgroupbyZdescriberrMrr r3r r rÚtest_to_latex_groupby_tabularŠs$þÿÿz3TestToLatexMultiindex.test_to_latex_groupby_tabularcCs>ttj ddg¡dgd}|jdd}tdƒ}||ks:t‚dS)N)rpr=)rqr=ÚcolrìFrõzÙ
            \begin{tabular}{lll}
            \toprule
             &  & col \\
            \midrule
            A & c & NaN \\
            B & c & NaN \\
            \bottomrule
            \end{tabular}
            )rrírîÚ from_tuplesrrr r3r r rÚ#test_to_latex_multiindex_dupe_level¢sÿ ÿ z9TestToLatexMultiindex.test_to_latex_multiindex_dupe_levelcCs | ¡}tdƒ}||kst‚dS)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!rár4r5r r rÚ!test_to_latex_multicolumn_default¼s
ÿz7TestToLatexMultiindex.test_to_latex_multicolumn_defaultcCs&|jddd}tdƒ}||ks"t‚dS)NFr<)Ú 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‡rr r rÚtest_to_latex_multicolumn_falseÐs
ÿz5TestToLatexMultiindex.test_to_latex_multicolumn_falsecCs&|jjdd}tdƒ}||ks"t‚dS)NTrõ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}
            )rÞrrr rr r rÚtest_to_latex_multirow_trueäs
ÿz1TestToLatexMultiindex.test_to_latex_multirow_truecCs4|jj|_|jjdddd}tdƒ}||ks0t‚dS)NTr=)rãrra=
            \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}
            )rÞr8rrr rr r rÚ1test_to_latex_multicolumnrow_with_multicol_formatús
ýÿzGTestToLatexMultiindex.test_to_latex_multicolumnrow_with_multicol_formatÚname0NZnamed0Úname1Znamed1Úaxesrrc sÎ||g}tj ddgddgg¡}td| ¡| ¡d}ˆD]}||j|_q:tdd„|Dƒƒ}d    ˆkr†t|ƒr†|d    ›d
|d›d nd }    ‡fd d„|Dƒ}
|j    dd} dtt
|
ƒ|    gƒ} | | ksÊt ‚dS)Nrrr`rarërìcss|]}|p dVqdS)rèNr ©rÕÚnr r rÚ    <genexpr>!szGTestToLatexMultiindex.test_to_latex_multiindex_names.<locals>.<genexpr>rz & z &  &  &  &  \\
rècs$g|]}t|ƒrdˆkr|nd‘qS)rrè)Úboolr
©r    r rÚ
<listcomp>'szHTestToLatexMultiindex.test_to_latex_multiindex_names.<locals>.<listcomp>Frõ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    rêÚtupleÚanyrrŽr ) r!rrr    rêrðr.ÚidxZ    idx_namesZ idx_names_rowZ    col_namesrær5r rrÚtest_to_latex_multiindex_namess(ÿÿý   ÿõz4TestToLatexMultiindex.test_to_latex_multiindex_namesÚone_rowTFcCsntddgddgddgdœƒ}|r,|jdg}| dd    g¡jd
d }td ƒ}|sV|d 7}|d7}||ksjt‚dS)Nrrr`rar;rcrrrFrõz¢
            \begin{tabular}{llr}
            \toprule
             &  & c \\
            a & b &  \\
            \midrule
            NaN & 2 & 4 \\
            z1.000000 & 3 & 5 \\
z\bottomrule
\end{tabular}
)rZilocrårrr )r!rr.rær5r r rÚtest_to_latex_multiindex_nans:s ÿ
z3TestToLatexMultiindex.test_to_latex_multiindex_nanscCsBtdddggdƒ ddg¡}|jdd}tdƒ}||ks>t‚dS)Nrrr`rFrõzê
            \begin{tabular}{llr}
            \toprule
             &  & 2 \\
            0 & 1 &  \\
            \midrule
            1 & 2 & 3 \\
             & 2 & 3 \\
            \bottomrule
            \end{tabular}
            rär3r r rÚtest_to_latex_non_string_indexSs  ÿ z4TestToLatexMultiindex.test_to_latex_non_string_indexcCsZtjjddgdddgddggddd    gd
}t|d }|jd d d}tdƒ}||ksVt‚dS)Ngrvr¹r¸Ú0Ú1ÚiZval0Zval1rér7TF)rã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ïrrrr )r!rðr.r4r5r r rÚ!test_to_latex_multiindex_multirowfsÿ
ÿz7TestToLatexMultiindex.test_to_latex_multiindex_multirow)rTrUrVrBr›rßrárçrñrôrör÷rørúrürÿrrrrrWrXrrrrr r r rrÓés2
 
!
rÓc@s@eZdZejdd„ƒZejdd„ƒZdd„Zdd„Zd    d
„Z    d S) ÚTestTableBuildercCstddgddgdœƒS)Nrrrrrrrr r rÚ    dataframeszTestTableBuilder.dataframecCstt|ƒdS)N©Ú    formatter)rr)r!rr r rÚ table_builder‘szTestTableBuilder.table_buildercCs|jdd}t|tƒst‚dS)Nri©Zover)Ú_create_row_iteratorÚ
isinstancer    r ©r!r Úiteratorr r rÚtest_create_row_iterator•s z)TestTableBuilder.test_create_row_iteratorcCs|jdd}t|tƒst‚dS)NÚbodyr!)r"r#rr r$r r rÚtest_create_body_iterator™s z*TestTableBuilder.test_create_body_iteratorc    Cs*tjtdd|jddW5QRXdS)Nz!must be either 'header' or 'body'r>z SOMETHING BADr!)rBrCrDr")r!r r r rÚ#test_create_body_wrong_kwarg_raisessz4TestTableBuilder.test_create_body_wrong_kwarg_raisesN)
rTrUrVrBr›rr r&r(r)r r r rrŒs
 
rc@s`eZdZej ddddg¡dd„ƒZej dddd    g¡d
d „ƒZej dd d dg¡dd„ƒZdS)ÚTestRowStringConverterzrow_num, expected)rz{} &  Design &  ratio &  xy \\)rz0 &       1 &      4 &  10 \\)rz1 &       2 &      5 &  11 \\cCsLtdddgdddgddd    gd
œƒ}tt|d d d }|j|d|ksHt‚dS)Nrrr`rar;rbé
é é )ZDesignZratior”Tržr©Úrow_num©rr
rÚ
get_strrowr ©r!r/r5r.Zrow_string_converterr r rÚ%test_get_strrow_normal_without_escape£s
    "
ÿz<TestRowStringConverter.test_get_strrow_normal_without_escape)rz'{} &  Design \# &  ratio, \% &  x\&y \\)rz#0 &         1 &         4 &   10 \\)rz#1 &         2 &         5 &   11 \\cCsLtdddgdddgddd    gd
œƒ}tt|d d d }|j|d|ksHt‚dS)Nrrr`rar;rbr+r,r-)zDesign #zratio, %zx&yTržrr.r0r2r r rÚ"test_get_strrow_normal_with_escape²s    ÿ
ÿz9TestRowStringConverter.test_get_strrow_normal_with_escape)rz<{} & \multicolumn{2}{r}{c1} & \multicolumn{2}{r}{c2} & c3 \\)rz{} &  0 &  1 &  0 &  1 &  0 \\)rz0 &  0 &  5 &  0 &  5 &  0 \\cCs†tdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdd„tdƒDƒdœƒ}tt|ƒd    d
d    d }|j|d |ks‚t‚dS) NcSsi|]
}||“qSr r rÔr r rrÖÎszPTestRowStringConverter.test_get_strrow_multindex_multicolumn.<locals>.<dictcomp>r;cSsi|]}||d“qSràr rÔr r rrÖÏscSsi|]
}||“qSr r rÔr r rrÖÐscSsi|]}||d“qSràr rÔr r rrÖÑscSsi|]
}||“qSr r rÔr r rrÖÒsrØTr*)rrrrãr.)rrÝr
rr1r r2r r rÚ%test_get_strrow_multindex_multicolumnÃs    ûÿ
üz<TestRowStringConverter.test_get_strrow_multindex_multicolumnN)    rTrUrVrBrWrXr3r4r5r r r rr*¢s0ýþ
ýþ
    ýþr*)"r,rÚtextwraprrBZpandasrírrZpandas._testingZ_testingrZpandas.io.formats.formatrZpandas.io.formats.latexrrr    r
Z importorskiprr›rrrYrgrzr~rœr°r·rÓrr*r r r rÚ<module>s:    
 
 
[n&D]2b&