From 70803d5444de2be8e95185e261f0e8e8f1d93ef7 Mon Sep 17 00:00:00 2001 From: "Yuan Tang (Terry)" Date: Fri, 11 Sep 2015 01:25:11 -0400 Subject: [PATCH] DOC: Modified incorrect doc-string for DataFrameFormatter and removed outdated doc-string (+1 squashed commit) Squashed commits: [068b1fd] DOC: Modified incorrect doc-string for DataFrameFormatter using new doc-string design (+1 squashed commit) Squashed commits: [12e032d] DOC: Updated doc-string using new doc-string design for DataFrameFormatter `DataFrameFormatter` does not have this parameter: `force_unicode_docstring`. --- pandas/core/format.py | 9 ++------- pandas/core/frame.py | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pandas/core/format.py b/pandas/core/format.py index 985b349273130..0c1a3dbadbd86 100644 --- a/pandas/core/format.py +++ b/pandas/core/format.py @@ -58,18 +58,13 @@ the print configuration (controlled by set_option), 'right' out of the box.""" -force_unicode_docstring = """ - force_unicode : bool, default False - Always return a unicode result. Deprecated in v0.10.0 as string - formatting is now rendered to unicode by default.""" - return_docstring = """ Returns ------- formatted : string (or unicode, depending on data and options)""" -docstring_to_string = common_docstring + justify_docstring + force_unicode_docstring + return_docstring +docstring_to_string = common_docstring + justify_docstring + return_docstring class CategoricalFormatter(object): @@ -300,7 +295,7 @@ class DataFrameFormatter(TableFormatter): """ __doc__ = __doc__ if __doc__ else '' - __doc__ += docstring_to_string + __doc__ += common_docstring + justify_docstring + return_docstring def __init__(self, frame, buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 77b8c4cf35aad..0eeface27238f 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1414,7 +1414,7 @@ def to_stata( write_index=write_index) writer.write_file() - @Appender(fmt.common_docstring + fmt.justify_docstring + fmt.return_docstring, indents=1) + @Appender(fmt.docstring_to_string, indents=1) def to_string(self, buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True, @@ -1442,7 +1442,7 @@ def to_string(self, buf=None, columns=None, col_space=None, result = formatter.buf.getvalue() return result - @Appender(fmt.common_docstring + fmt.justify_docstring + fmt.return_docstring, indents=1) + @Appender(fmt.docstring_to_string, indents=1) def to_html(self, buf=None, columns=None, col_space=None, colSpace=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True,