@@ -2825,7 +2825,7 @@ class (index) object 'bird' 'bird' 'mammal' 'mammal'
2825
2825
else :
2826
2826
return xarray .Dataset .from_dataframe (self )
2827
2827
2828
- @Substitution (returns = fmt .return_docstring )
2828
+ @doc (returns = fmt .return_docstring )
2829
2829
def to_latex (
2830
2830
self ,
2831
2831
buf = None ,
@@ -2853,9 +2853,9 @@ def to_latex(
2853
2853
r"""
2854
2854
Render object to a LaTeX tabular, longtable, or nested table/tabular.
2855
2855
2856
- Requires ``\usepackage{booktabs}``. The output can be copy/pasted
2856
+ Requires ``\usepackage{{ booktabs} }``. The output can be copy/pasted
2857
2857
into a main LaTeX document or read from an external file
2858
- with ``\input{table.tex}``.
2858
+ with ``\input{{ table.tex} }``.
2859
2859
2860
2860
.. versionchanged:: 0.20.2
2861
2861
Added to Series.
@@ -2878,13 +2878,13 @@ def to_latex(
2878
2878
Write row names (index).
2879
2879
na_rep : str, default 'NaN'
2880
2880
Missing data representation.
2881
- formatters : list of functions or dict of {str: function}, optional
2881
+ formatters : list of functions or dict of {{ str: function} }, optional
2882
2882
Formatter functions to apply to columns' elements by position or
2883
2883
name. The result of each function must be a unicode string.
2884
2884
List must be of length equal to the number of columns.
2885
2885
float_format : one-parameter function or str, optional, default None
2886
2886
Formatter for floating point numbers. For example
2887
- ``float_format="%% .2f"`` and ``float_format="{:0.2f}".format`` will
2887
+ ``float_format="%.2f"`` and ``float_format="{{ :0.2f} }".format`` will
2888
2888
both result in 0.1234 being formatted as 0.12.
2889
2889
sparsify : bool, optional
2890
2890
Set to False for a DataFrame with a hierarchical index to print
@@ -2902,7 +2902,7 @@ def to_latex(
2902
2902
longtable : bool, optional
2903
2903
By default, the value will be read from the pandas config
2904
2904
module. Use a longtable environment instead of tabular. Requires
2905
- adding a \usepackage{longtable} to your LaTeX preamble.
2905
+ adding a \usepackage{{ longtable} } to your LaTeX preamble.
2906
2906
escape : bool, optional
2907
2907
By default, the value will be read from the pandas config
2908
2908
module. When set to False prevents from escaping latex special
@@ -2920,21 +2920,21 @@ def to_latex(
2920
2920
The default will be read from the config module.
2921
2921
multirow : bool, default False
2922
2922
Use \multirow to enhance MultiIndex rows. Requires adding a
2923
- \usepackage{multirow} to your LaTeX preamble. Will print
2923
+ \usepackage{{ multirow} } to your LaTeX preamble. Will print
2924
2924
centered labels (instead of top-aligned) across the contained
2925
2925
rows, separating groups via clines. The default will be read
2926
2926
from the pandas config module.
2927
2927
caption : str, optional
2928
- The LaTeX caption to be placed inside ``\caption{}`` in the output.
2928
+ The LaTeX caption to be placed inside ``\caption{{} }`` in the output.
2929
2929
2930
2930
.. versionadded:: 1.0.0
2931
2931
2932
2932
label : str, optional
2933
- The LaTeX label to be placed inside ``\label{}`` in the output.
2934
- This is used with ``\ref{}`` in the main ``.tex`` file.
2933
+ The LaTeX label to be placed inside ``\label{{} }`` in the output.
2934
+ This is used with ``\ref{{} }`` in the main ``.tex`` file.
2935
2935
2936
2936
.. versionadded:: 1.0.0
2937
- %( returns)s
2937
+ { returns}
2938
2938
See Also
2939
2939
--------
2940
2940
DataFrame.to_string : Render a DataFrame to a console-friendly
@@ -2943,18 +2943,18 @@ def to_latex(
2943
2943
2944
2944
Examples
2945
2945
--------
2946
- >>> df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
2946
+ >>> df = pd.DataFrame({{ 'name': ['Raphael', 'Donatello'],
2947
2947
... 'mask': ['red', 'purple'],
2948
- ... 'weapon': ['sai', 'bo staff']})
2948
+ ... 'weapon': ['sai', 'bo staff']}} )
2949
2949
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE
2950
- \begin{tabular}{ lll}
2950
+ \begin{{ tabular}}{{ lll} }
2951
2951
\toprule
2952
2952
name & mask & weapon \\
2953
2953
\midrule
2954
2954
Raphael & red & sai \\
2955
2955
Donatello & purple & bo staff \\
2956
2956
\bottomrule
2957
- \end{tabular}
2957
+ \end{{ tabular} }
2958
2958
"""
2959
2959
# Get defaults from the pandas config
2960
2960
if self .ndim == 1 :
0 commit comments