diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 02241eeaae7b2..aa59dc5de6896 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -775,7 +775,8 @@ def style(self): Iterates over the DataFrame columns, returning a tuple with the column name and the content as a Series. - %s + Yields + ------ label : object The column names for the DataFrame being iterated over. content : Series @@ -816,7 +817,7 @@ def style(self): Name: population, dtype: int64 """ - @Appender(_shared_docs["items"] % "Yields\n ------") + @Appender(_shared_docs["items"]) def items(self): if self.columns.is_unique and hasattr(self, "_item_cache"): for k in self.columns: @@ -825,9 +826,9 @@ def items(self): for i, k in enumerate(self.columns): yield k, self._ixs(i, axis=1) - @Appender(_shared_docs["items"] % "Returns\n -------") + @Appender(_shared_docs["items"]) def iteritems(self): - return self.items() + yield from self.items() def iterrows(self): """