Skip to content

Commit

Permalink
DOC: update the DataFrame.iat[] docstring (pandas-dev#20219)
Browse files Browse the repository at this point in the history
* DOC: update the DataFrame.iat[] docstring

* Update based on PR comments

* Update based on PR comments

* Singular not plural

* Update to account for use with Series. Add example using Series.

* Update indexing.py

* PEP8
  • Loading branch information
akosel authored and TomAugspurger committed Mar 11, 2018
1 parent 302fda4 commit 080ef0c
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,11 +1920,49 @@ def _convert_key(self, key, is_setter=False):


class _iAtIndexer(_ScalarAccessIndexer):
"""Fast integer location scalar accessor.
"""
Access a single value for a row/column pair by integer position.
Similarly to ``iloc``, ``iat`` provides **integer** based lookups.
You can also set using these indexers.
Similar to ``iloc``, in that both provide integer-based lookups. Use
``iat`` if you only need to get or set a single value in a DataFrame
or Series.
See Also
--------
DataFrame.at : Access a single value for a row/column label pair
DataFrame.loc : Access a group of rows and columns by label(s)
DataFrame.iloc : Access a group of rows and columns by integer position(s)
Examples
--------
>>> df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],
... columns=['A', 'B', 'C'])
>>> df
A B C
0 0 2 3
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 comments on commit 080ef0c

Please sign in to comment.