-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add print statement in to_latex example #27798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2993,10 +2993,17 @@ def to_latex( | |
>>> df = pd.DataFrame({'name': ['Raphael', 'Donatello'], | ||
... 'mask': ['red', 'purple'], | ||
... 'weapon': ['sai', 'bo staff']}) | ||
>>> df.to_latex(index=False) # doctest: +NORMALIZE_WHITESPACE | ||
'\\begin{tabular}{lll}\n\\toprule\n name & mask & weapon | ||
\\\\\n\\midrule\n Raphael & red & sai \\\\\n Donatello & | ||
purple & bo staff \\\\\n\\bottomrule\n\\end{tabular}\n' | ||
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE | ||
'\begin{tabular}{lll} | ||
\toprule | ||
name & mask & weapon \\ | ||
\midrule | ||
Raphael & red & sai \\ | ||
Donatello & purple & bo staff \\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me the
|
||
\bottomrule | ||
\end{tabular} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and a very small detail: can you remove this trailing white line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept it because it looked like it was there in the output when I tried it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But removed now |
||
' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and the same here |
||
""" | ||
# Get defaults from the pandas config | ||
if self.ndim == 1: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the single quote (the first character) should also be removed (isn't showed by python when printing)