Skip to content

DOC: Updated doc-string using new doc-string design for DataFrameFormatter #11057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down