Skip to content

Commit 584b154

Browse files
sameshljorisvandenbossche
authored andcommitted
DOC:Use of "Yields" for documentation of DataFrame.iteritems() (#27876)
1 parent 5de4e55 commit 584b154

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/core/frame.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ def style(self):
775775
Iterates over the DataFrame columns, returning a tuple with
776776
the column name and the content as a Series.
777777
778-
%s
778+
Yields
779+
------
779780
label : object
780781
The column names for the DataFrame being iterated over.
781782
content : Series
@@ -816,7 +817,7 @@ def style(self):
816817
Name: population, dtype: int64
817818
"""
818819

819-
@Appender(_shared_docs["items"] % "Yields\n ------")
820+
@Appender(_shared_docs["items"])
820821
def items(self):
821822
if self.columns.is_unique and hasattr(self, "_item_cache"):
822823
for k in self.columns:
@@ -825,9 +826,9 @@ def items(self):
825826
for i, k in enumerate(self.columns):
826827
yield k, self._ixs(i, axis=1)
827828

828-
@Appender(_shared_docs["items"] % "Returns\n -------")
829+
@Appender(_shared_docs["items"])
829830
def iteritems(self):
830-
return self.items()
831+
yield from self.items()
831832

832833
def iterrows(self):
833834
"""

0 commit comments

Comments
 (0)