-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Improve the docsting of Series.iteritems #24879
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
Changes from 4 commits
92ab782
0aa8a10
a8b96e6
baaaa07
45d7841
d062f8d
b0da5c3
15735ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1446,6 +1446,30 @@ def to_string(self, buf=None, na_rep='NaN', float_format=None, header=True, | |
def iteritems(self): | ||
""" | ||
Lazily iterate over (index, value) tuples. | ||
|
||
This method returns an iterable tuple (index, value). This is | ||
convienient if you want to create a a Lazy iterator. | ||
|
||
Returns | ||
------- | ||
iterable | ||
Iterable of tuples containing the (index, value) pairs from a | ||
Series. | ||
|
||
See Also | ||
-------- | ||
Series.apply : Invoke function on values of Series. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless I am mistaken, it seems to me that Series.iteritems and Series.items are the same method. The docstring of items and iteritems will be the same I don't think that this is a good idea. I will mention it in the description instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that apply and map aren't closely enough related to include here - can you remove? |
||
Series.map : Map values of Series according to input correspondence. | ||
DataFrame.iteritems : Equivalent to Series.iteritems for DataFrame. | ||
|
||
Examples | ||
-------- | ||
>>> s = pd.Series(['A', 'B', 'C']) | ||
>>> for index, value in s.iteritems(): | ||
... print("Index : {}, Value : {}".format(index, value)) | ||
Index : 0, Value : A | ||
Index : 1, Value : B | ||
Index : 2, Value : C | ||
""" | ||
return zip(iter(self.index), iter(self)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2
a
s on this line. Lowercase l onLazy