Skip to content

Commit 13b3fcd

Browse files
committed
Fix docstrings
1 parent 8ed92ef commit 13b3fcd

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed

pandas/core/frame.py

+15-25
Original file line numberDiff line numberDiff line change
@@ -2048,24 +2048,21 @@ def to_parquet(self, fname, engine='auto', compression='snappy',
20482048
def to_string(self, buf=None, columns=None, col_space=None, header=True,
20492049
index=True, na_rep='NaN', formatters=None, float_format=None,
20502050
sparsify=None, index_names=True, justify=None,
2051-
line_width=None, max_rows=None, max_cols=None,
2052-
show_dimensions=False):
2051+
max_rows=None, max_cols=None, show_dimensions=False,
2052+
decimal='.', line_width=None):
20532053
"""
20542054
Render a DataFrame to a console-friendly tabular output.
2055-
20562055
%(shared_params)s
20572056
line_width : int, optional
20582057
Width to wrap a line in characters.
2059-
20602058
%(returns)s
2061-
20622059
See Also
20632060
--------
20642061
to_html : Convert DataFrame to HTML.
20652062
20662063
Examples
20672064
--------
2068-
>>> d = {'col1' : [1, 2, 3], 'col2' : [4, 5, 6]}
2065+
>>> d = {'col1': [1, 2, 3], 'col2': [4, 5, 6]}
20692066
>>> df = pd.DataFrame(d)
20702067
>>> print(df.to_string())
20712068
col1 col2
@@ -2081,42 +2078,37 @@ def to_string(self, buf=None, columns=None, col_space=None, header=True,
20812078
sparsify=sparsify, justify=justify,
20822079
index_names=index_names,
20832080
header=header, index=index,
2084-
line_width=line_width,
20852081
max_rows=max_rows,
20862082
max_cols=max_cols,
2087-
show_dimensions=show_dimensions)
2083+
show_dimensions=show_dimensions,
2084+
decimal=decimal,
2085+
line_width=line_width)
20882086
formatter.to_string()
20892087

20902088
if buf is None:
20912089
result = formatter.buf.getvalue()
20922090
return result
20932091

2094-
@Substitution(header='whether to print column labels, default True')
2092+
@Substitution(header='Whether to print column labels, default True')
20952093
@Substitution(shared_params=fmt.common_docstring,
20962094
returns=fmt.return_docstring)
20972095
def to_html(self, buf=None, columns=None, col_space=None, header=True,
20982096
index=True, na_rep='NaN', formatters=None, float_format=None,
2099-
sparsify=None, index_names=True, justify=None, bold_rows=True,
2100-
classes=None, escape=True, max_rows=None, max_cols=None,
2101-
show_dimensions=False, notebook=False, decimal='.',
2102-
border=None, table_id=None):
2097+
sparsify=None, index_names=True, justify=None, max_rows=None,
2098+
max_cols=None, show_dimensions=False, decimal='.',
2099+
bold_rows=True, classes=None, escape=True,
2100+
notebook=False, border=None, table_id=None):
21032101
"""
21042102
Render a DataFrame as an HTML table.
2105-
21062103
%(shared_params)s
2107-
bold_rows : boolean, default True
2108-
Make the row labels bold in the output
2104+
bold_rows : bool, default True
2105+
Make the row labels bold in the output.
21092106
classes : str or list or tuple, default None
2110-
CSS class(es) to apply to the resulting html table
2111-
escape : boolean, default True
2107+
CSS class(es) to apply to the resulting html table.
2108+
escape : bool, default True
21122109
Convert the characters <, >, and & to HTML-safe sequences.
21132110
notebook : {True, False}, default False
21142111
Whether the generated HTML is for IPython Notebook.
2115-
decimal : string, default '.'
2116-
Character recognized as decimal separator, e.g. ',' in Europe
2117-
2118-
.. versionadded:: 0.18.0
2119-
21202112
border : int
21212113
A ``border=border`` attribute is included in the opening
21222114
`<table>` tag. Default ``pd.options.html.border``.
@@ -2127,9 +2119,7 @@ def to_html(self, buf=None, columns=None, col_space=None, header=True,
21272119
A css id is included in the opening `<table>` tag if specified.
21282120
21292121
.. versionadded:: 0.23.0
2130-
21312122
%(returns)s
2132-
21332123
See Also
21342124
--------
21352125
to_string : Convert DataFrame to a string.

pandas/io/formats/format.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
Maximum number of columns to display in the console.
8989
show_dimensions : bool, default False
9090
Display DataFrame dimensions (number of rows by number of columns).
91+
decimal : str, default '.'
92+
Character recognized as decimal separator, e.g. ',' in Europe.
93+
94+
.. versionadded:: 0.18.0
9195
"""
9296

9397
_VALID_JUSTIFY_PARAMETERS = ("left", "right", "center", "justify",
@@ -101,8 +105,6 @@
101105
String representation of the dataframe.
102106
"""
103107

104-
docstring_to_string = common_docstring + return_docstring
105-
106108

107109
class CategoricalFormatter(object):
108110

0 commit comments

Comments
 (0)