Skip to content

Commit fae84ec

Browse files
sameshljorisvandenbossche
authored andcommitted
DOC: add print statement in to_latex example (pandas-dev#27798)
1 parent 3ae18d5 commit fae84ec

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pandas/core/generic.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -2993,10 +2993,15 @@ def to_latex(
29932993
>>> df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
29942994
... 'mask': ['red', 'purple'],
29952995
... 'weapon': ['sai', 'bo staff']})
2996-
>>> df.to_latex(index=False) # doctest: +NORMALIZE_WHITESPACE
2997-
'\\begin{tabular}{lll}\n\\toprule\n name & mask & weapon
2998-
\\\\\n\\midrule\n Raphael & red & sai \\\\\n Donatello &
2999-
purple & bo staff \\\\\n\\bottomrule\n\\end{tabular}\n'
2996+
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE
2997+
\begin{tabular}{lll}
2998+
\toprule
2999+
name & mask & weapon \\
3000+
\midrule
3001+
Raphael & red & sai \\
3002+
Donatello & purple & bo staff \\
3003+
\bottomrule
3004+
\end{tabular}
30003005
"""
30013006
# Get defaults from the pandas config
30023007
if self.ndim == 1:

0 commit comments

Comments
 (0)