Skip to content

Commit 840f88e

Browse files
committed
Merge pull request #11057 from terrytangyuan/patch-1
DOC: Updated doc-string using new doc-string design for DataFrameFormatter
2 parents fea7f6c + 70803d5 commit 840f88e

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pandas/core/format.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,13 @@
5858
the print configuration (controlled by set_option), 'right' out
5959
of the box."""
6060

61-
force_unicode_docstring = """
62-
force_unicode : bool, default False
63-
Always return a unicode result. Deprecated in v0.10.0 as string
64-
formatting is now rendered to unicode by default."""
65-
6661
return_docstring = """
6762
6863
Returns
6964
-------
7065
formatted : string (or unicode, depending on data and options)"""
7166

72-
docstring_to_string = common_docstring + justify_docstring + force_unicode_docstring + return_docstring
67+
docstring_to_string = common_docstring + justify_docstring + return_docstring
7368

7469
class CategoricalFormatter(object):
7570

@@ -300,7 +295,7 @@ class DataFrameFormatter(TableFormatter):
300295
"""
301296

302297
__doc__ = __doc__ if __doc__ else ''
303-
__doc__ += docstring_to_string
298+
__doc__ += common_docstring + justify_docstring + return_docstring
304299

305300
def __init__(self, frame, buf=None, columns=None, col_space=None,
306301
header=True, index=True, na_rep='NaN', formatters=None,

pandas/core/frame.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ def to_stata(
14141414
write_index=write_index)
14151415
writer.write_file()
14161416

1417-
@Appender(fmt.common_docstring + fmt.justify_docstring + fmt.return_docstring, indents=1)
1417+
@Appender(fmt.docstring_to_string, indents=1)
14181418
def to_string(self, buf=None, columns=None, col_space=None,
14191419
header=True, index=True, na_rep='NaN', formatters=None,
14201420
float_format=None, sparsify=None, index_names=True,
@@ -1442,7 +1442,7 @@ def to_string(self, buf=None, columns=None, col_space=None,
14421442
result = formatter.buf.getvalue()
14431443
return result
14441444

1445-
@Appender(fmt.common_docstring + fmt.justify_docstring + fmt.return_docstring, indents=1)
1445+
@Appender(fmt.docstring_to_string, indents=1)
14461446
def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
14471447
header=True, index=True, na_rep='NaN', formatters=None,
14481448
float_format=None, sparsify=None, index_names=True,

0 commit comments

Comments
 (0)