@@ -440,15 +440,13 @@ def test_to_latex_longtable(self):
440
440
441
441
def test_to_latex_caption_label (self ):
442
442
# GH 25436
443
- the_caption = ' a table in a \\ texttt{table/tabular} environment'
444
- the_label = ' tab:table_tabular'
443
+ the_caption = " a table in a \\ texttt{table/tabular} environment"
444
+ the_label = " tab:table_tabular"
445
445
446
- df = DataFrame ({'a' : [1 , 2 ], 'b' : ['b1' , 'b2' ]})
446
+ df = DataFrame ({"a" : [1 , 2 ], "b" : ["b1" , "b2" ]})
447
447
448
448
# test when only the caption is provided
449
- result_c = df .to_latex (
450
- caption = the_caption
451
- )
449
+ result_c = df .to_latex (caption = the_caption )
452
450
453
451
expected_c = r"""\begin{table}
454
452
\centering
@@ -466,9 +464,7 @@ def test_to_latex_caption_label(self):
466
464
assert result_c == expected_c
467
465
468
466
# test when only the label is provided
469
- result_l = df .to_latex (
470
- label = the_label
471
- )
467
+ result_l = df .to_latex (label = the_label )
472
468
473
469
expected_l = r"""\begin{table}
474
470
\centering
@@ -486,10 +482,7 @@ def test_to_latex_caption_label(self):
486
482
assert result_l == expected_l
487
483
488
484
# test when the caption and the label are provided
489
- result_cl = df .to_latex (
490
- caption = the_caption ,
491
- label = the_label
492
- )
485
+ result_cl = df .to_latex (caption = the_caption , label = the_label )
493
486
494
487
expected_cl = r"""\begin{table}
495
488
\centering
@@ -509,16 +502,13 @@ def test_to_latex_caption_label(self):
509
502
510
503
def test_to_latex_longtable_caption_label (self ):
511
504
# GH 25436
512
- the_caption = ' a table in a \\ texttt{longtable} environment'
513
- the_label = ' tab:longtable'
505
+ the_caption = " a table in a \\ texttt{longtable} environment"
506
+ the_label = " tab:longtable"
514
507
515
- df = DataFrame ({'a' : [1 , 2 ], 'b' : ['b1' , 'b2' ]})
508
+ df = DataFrame ({"a" : [1 , 2 ], "b" : ["b1" , "b2" ]})
516
509
517
510
# test when only the caption is provided
518
- result_c = df .to_latex (
519
- longtable = True ,
520
- caption = the_caption
521
- )
511
+ result_c = df .to_latex (longtable = True , caption = the_caption )
522
512
523
513
expected_c = r"""\begin{longtable}{lrl}
524
514
\caption{a table in a \texttt{longtable} environment}\\
@@ -540,10 +530,7 @@ def test_to_latex_longtable_caption_label(self):
540
530
assert result_c == expected_c
541
531
542
532
# test when only the label is provided
543
- result_l = df .to_latex (
544
- longtable = True ,
545
- label = the_label ,
546
- )
533
+ result_l = df .to_latex (longtable = True , label = the_label )
547
534
548
535
expected_l = r"""\begin{longtable}{lrl}
549
536
\label{tab:longtable}\\
@@ -565,11 +552,7 @@ def test_to_latex_longtable_caption_label(self):
565
552
assert result_l == expected_l
566
553
567
554
# test when the caption and the label are provided
568
- result_cl = df .to_latex (
569
- longtable = True ,
570
- caption = the_caption ,
571
- label = the_label ,
572
- )
555
+ result_cl = df .to_latex (longtable = True , caption = the_caption , label = the_label )
573
556
574
557
expected_cl = r"""\begin{longtable}{lrl}
575
558
\caption{a table in a \texttt{longtable} environment}\label{tab:longtable}\\
0 commit comments