-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
TomAugspurger
merged 4 commits into
pandas-dev:master
from
akosel:docstring_dataframe_at
Mar 12, 2018
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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 | ||
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. Capitalize Series |
||
|
||
>>> df.loc[5].at['B'] | ||
4 | ||
|
||
Raises | ||
------ | ||
KeyError | ||
When label does not exist in DataFrame | ||
""" | ||
|
||
_takeable = False | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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