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

Conversation

akosel
Copy link
Contributor

@akosel akosel commented Mar 12, 2018

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

  • PR title is "DOC: update the docstring"
  • The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • The html version looks good: python doc/make.py --single <your-function-or-method>
  • It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

# paste output of "scripts/validate_docstrings.py <your-function-or-method>" here
# between the "```" (remove this comment, but keep the "```")
################################################################################
####################### Docstring (pandas.DataFrame.at)  #######################
################################################################################

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

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

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

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

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
	No returns section found

If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Very minor edits otherwise looks good


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

>>> 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

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Apart from the comments of @WillAyd, looks good!

@akosel
Copy link
Contributor Author

akosel commented Mar 12, 2018

Thank you for the comments! I believe I have addressed them all, but please let me know if there's anything else that can be improved.

@codecov
Copy link

codecov bot commented Mar 12, 2018

Codecov Report

Merging #20290 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20290      +/-   ##
==========================================
+ Coverage    91.7%   91.73%   +0.02%     
==========================================
  Files         150      150              
  Lines       49168    49168              
==========================================
+ Hits        45090    45102      +12     
+ Misses       4078     4066      -12
Flag Coverage Δ
#multiple 90.11% <ø> (+0.02%) ⬆️
#single 41.86% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/indexing.py 93.02% <ø> (ø) ⬆️
pandas/plotting/_converter.py 66.81% <0%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df2e361...d3f78b4. Read the comment docs.

@TomAugspurger TomAugspurger merged commit ac3d893 into pandas-dev:master Mar 12, 2018
@TomAugspurger
Copy link
Contributor

Thanks @akosel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants