diff --git a/pandas/core/format.py b/pandas/core/format.py index 30baa4345caf2..482932f73e67c 100644 --- a/pandas/core/format.py +++ b/pandas/core/format.py @@ -156,6 +156,7 @@ class DataFrameFormatter(object): """ + __doc__ = __doc__ if __doc__ else '' __doc__ += docstring_to_string def __init__(self, frame, buf=None, columns=None, col_space=None, diff --git a/pandas/util/decorators.py b/pandas/util/decorators.py index 5f535c7780c27..5cd87a1e9c683 100644 --- a/pandas/util/decorators.py +++ b/pandas/util/decorators.py @@ -93,7 +93,9 @@ def __init__(self, addendum, join='', indents=0): self.join = join def __call__(self, func): - docitems = [func.__doc__ if func.__doc__ else '', self.addendum] + func.__doc__ = func.__doc__ if func.__doc__ else '' + self.addendum = self.addendum if self.addendum else '' + docitems = [func.__doc__, self.addendum] func.__doc__ = ''.join(docitems) return func