8000 DOC: update the DataFrame.iat[] docstring by akosel · Pull Request #20219 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DOC: update the DataFrame.iat[] docstring #20219

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 7 commits into from
Mar 11, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update to account for use with Series. Add example using Series.
  • Loading branch information
akosel committed Mar 10, 2018
commit 88c23c0373335bc0faf82da092990e715c2d4cee
17 changes: 16 additions & 1 deletion pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,8 @@ class _iAtIndexer(_ScalarAccessIndexer):
Access a single value for a row/column pair by integer position.

Similar to ``iloc``, in that both provide integer-based lookups. Use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also works on a Series, can you re-word to accomodate

Copy link
Contributor Author
@akosel akosel Mar 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point, I specified that iat works for both a DataFrame and a Series (below the comment, so Github isn't collapsing it here). Let me know if you want be to reword it any differently. I also added an example for using it on Series.

``iat`` if you only need to get or set a single value in a DataFrame.
``iat`` if you only need to get or set a single value in a ``DataFrame``
or ``Series``.

See Also
--------
Expand All @@ -1942,12 +1943,26 @@ class _iAtIndexer(_ScalarAccessIndexer):
1 0 4 1
2 10 20 30

Get value at specified row/column pair

>>> df.iat[1, 2]
1

Set value at specified row/column pair

>>> df.iat[1, 2] = 10
>>> df.iat[1, 2]
10

Get value within a series

>>> df.loc[0].iat[1]
2

Raises
------
IndexError
When integer position is out of bounds
"""

_takeable = True
Expand Down
0