MCPcopy
hub / github.com/pandas-dev/pandas / test_concat_recursion

Function test_concat_recursion

pandas/tests/io/formats/style/test_to_latex.py:1020–1037  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1018
1019
1020def test_concat_recursion():
1021 # tests hidden row recursion and applied styles
1022 styler1 = DataFrame([[1], [9]]).style.hide([1]).highlight_min(color="red")
1023 styler2 = DataFrame([[9], [2]]).style.hide([0]).highlight_min(color="green")
1024 styler3 = DataFrame([[3], [9]]).style.hide([1]).highlight_min(color="blue")
1025
1026 result = styler1.concat(styler2.concat(styler3)).to_latex(convert_css=True)
1027 expected = dedent(
1028 """\
1029 \\begin{tabular}{lr}
1030 & 0 \\\\
1031 0 & {\\cellcolor{red}} 1 \\\\
1032 1 & {\\cellcolor{green}} 2 \\\\
1033 0 & {\\cellcolor{blue}} 3 \\\\
1034 \\end{tabular}
1035 """
1036 )
1037 assert result == expected
1038
1039
1040def test_concat_chain():

Callers

nothing calls this directly

Calls 5

DataFrameClass · 0.90
highlight_minMethod · 0.80
hideMethod · 0.80
concatMethod · 0.80
to_latexMethod · 0.45

Tested by

no test coverage detected