Skip to content

Commit d8d2b62

Browse files
author
Rebecca Sweger
committed
Add Series to_latex test
1 parent 74889fc commit d8d2b62

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pandas/tests/io/formats/test_to_latex.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
import pandas as pd
6-
from pandas import DataFrame, compat
6+
from pandas import DataFrame, compat, Series
77
from pandas.util import testing as tm
88
from pandas.compat import u
99
import codecs
@@ -491,3 +491,18 @@ def test_to_latex_decimal(self, frame):
491491
"""
492492

493493
assert withindex_result == withindex_expected
494+
495+
def test_to_latex_series(self):
496+
s = Series(['a', 'b', 'c'])
497+
withindex_result = s.to_latex()
498+
withindex_expected = r"""\begin{tabular}{ll}
499+
\toprule
500+
{} & 0 \\
501+
\midrule
502+
0 & a \\
503+
1 & b \\
504+
2 & c \\
505+
\bottomrule
506+
\end{tabular}
507+
"""
508+
assert withindex_result == withindex_expected

0 commit comments

Comments
 (0)