Skip to content

DOC: update the DataFrame.at[] docstring #20290

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 4 commits into from
Mar 12, 2018
Merged
Changes from 2 commits
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
47 changes: 44 additions & 3 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1888,11 +1888,52 @@ def __setitem__(self, key, value):


class _AtIndexer(_ScalarAccessIndexer):
"""Fast label-based scalar accessor
"""
Access a single value for a row/column label pair.

Similar to ``loc``, in that both provide label-based lookups. Use
``at`` if you only need to get or set a single value in a DataFrame
or Series.

See Also
--------
DataFrame.iat
Copy link
Member

Choose a reason for hiding this comment

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

For the See Also section the format should be item : description so move to the description up to the same line and just break where length exceeds 75 characters

Access a single value for a row/column pair by integer position
DataFrame.loc
Access a group of rows and columns by label(s)
Series.at
Access a single value using a label

Examples
--------
>>> df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],
... index=[4, 5, 6], columns=['A', 'B', 'C'])
>>> df
A B C
4 0 2 3
5 0 4 1
6 10 20 30

Similarly to ``loc``, ``at`` provides **label** based scalar lookups.
You can also set using these indexers.
Get value at specified row/column pair

>>> df.at[4, 'B']
2

Set value at specified row/column pair

>>> df.at[4, 'B'] = 10
>>> df.at[4, 'B']
10

Get value within a series
Copy link
Member

Choose a reason for hiding this comment

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

Capitalize Series


>>> df.loc[5].at['B']
4

Raises
------
KeyError
When label does not exist in DataFrame
"""

_takeable = False
Expand Down