Skip to content

Commit 6bd5b32

Browse files
committed
removed the remaining occurrences of Substitution in generic.py
1 parent 8f33cdc commit 6bd5b32

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pandas/core/generic.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,7 +2825,7 @@ class (index) object 'bird' 'bird' 'mammal' 'mammal'
28252825
else:
28262826
return xarray.Dataset.from_dataframe(self)
28272827

2828-
@Substitution(returns=fmt.return_docstring)
2828+
@doc(returns=fmt.return_docstring)
28292829
def to_latex(
28302830
self,
28312831
buf=None,
@@ -2853,9 +2853,9 @@ def to_latex(
28532853
r"""
28542854
Render object to a LaTeX tabular, longtable, or nested table/tabular.
28552855
2856-
Requires ``\usepackage{booktabs}``. The output can be copy/pasted
2856+
Requires ``\usepackage{{booktabs}}``. The output can be copy/pasted
28572857
into a main LaTeX document or read from an external file
2858-
with ``\input{table.tex}``.
2858+
with ``\input{{table.tex}}``.
28592859
28602860
.. versionchanged:: 0.20.2
28612861
Added to Series.
@@ -2878,13 +2878,13 @@ def to_latex(
28782878
Write row names (index).
28792879
na_rep : str, default 'NaN'
28802880
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
28822882
Formatter functions to apply to columns' elements by position or
28832883
name. The result of each function must be a unicode string.
28842884
List must be of length equal to the number of columns.
28852885
float_format : one-parameter function or str, optional, default None
28862886
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
28882888
both result in 0.1234 being formatted as 0.12.
28892889
sparsify : bool, optional
28902890
Set to False for a DataFrame with a hierarchical index to print
@@ -2902,7 +2902,7 @@ def to_latex(
29022902
longtable : bool, optional
29032903
By default, the value will be read from the pandas config
29042904
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.
29062906
escape : bool, optional
29072907
By default, the value will be read from the pandas config
29082908
module. When set to False prevents from escaping latex special
@@ -2920,21 +2920,21 @@ def to_latex(
29202920
The default will be read from the config module.
29212921
multirow : bool, default False
29222922
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
29242924
centered labels (instead of top-aligned) across the contained
29252925
rows, separating groups via clines. The default will be read
29262926
from the pandas config module.
29272927
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.
29292929
29302930
.. versionadded:: 1.0.0
29312931
29322932
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.
29352935
29362936
.. versionadded:: 1.0.0
2937-
%(returns)s
2937+
{returns}
29382938
See Also
29392939
--------
29402940
DataFrame.to_string : Render a DataFrame to a console-friendly
@@ -2943,18 +2943,18 @@ def to_latex(
29432943
29442944
Examples
29452945
--------
2946-
>>> df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
2946+
>>> df = pd.DataFrame({{'name': ['Raphael', 'Donatello'],
29472947
... 'mask': ['red', 'purple'],
2948-
... 'weapon': ['sai', 'bo staff']})
2948+
... 'weapon': ['sai', 'bo staff']}})
29492949
>>> print(df.to_latex(index=False)) # doctest: +NORMALIZE_WHITESPACE
2950-
\begin{tabular}{lll}
2950+
\begin{{tabular}}{{lll}}
29512951
\toprule
29522952
name & mask & weapon \\
29532953
\midrule
29542954
Raphael & red & sai \\
29552955
Donatello & purple & bo staff \\
29562956
\bottomrule
2957-
\end{tabular}
2957+
\end{{tabular}}
29582958
"""
29592959
# Get defaults from the pandas config
29602960
if self.ndim == 1:

0 commit comments

Comments
 (0)