-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: fix the pandas.DataFrame.add example #20077
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
DOC: fix the pandas.DataFrame.add example #20077
Conversation
pandas/core/ops.py
Outdated
two=[np.nan, 2, np.nan, 2]), | ||
index=['a', 'b', 'd', 'e']) | ||
... two=[np.nan, 2, np.nan, 2]), | ||
... index=['a', 'b', 'd', 'e']) |
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.
May need one more space here, so that the "i" in "index" is below the "d" in "dict'.
@@ -513,14 +513,14 @@ def _get_op_name(op, special): | |||
other : Series, DataFrame, or constant | |||
axis : {{0, 1, 'index', 'columns'}} | |||
For Series input, axis to match Series index on | |||
level : int or name |
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.
I think level : int or str
, though we're inconsistent here.
@jorisvandenbossche what should our policy be on index positions or labels? In principle, int or str
isn't quite right since index labels needn't be strings. It'd be int or object
, which isn't that informative. int or label
?
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.
Hmm, yes, this is a dubious one. "name" is technically not a 'type', but "str" would not be correct as you say. So maybe better to keep it that way.
If we keep the 'name' or 'label', wouldn't 'name' be better because it is here a index level name, not a label inside the index ?
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.
Ah, yes you're right I was mistaken.
And we can declare that "name" means anything that can go in {.index,.columns}{.name,.names}
.
Codecov Report
@@ Coverage Diff @@
## master #20077 +/- ##
==========================================
- Coverage 91.77% 91.7% -0.08%
==========================================
Files 152 150 -2
Lines 49175 49122 -53
==========================================
- Hits 45130 45045 -85
- Misses 4045 4077 +32
Continue to review full report at Codecov.
|
…string_for_pandas.DataFrame.rmul
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.
Fixed the merge conflict.
@4bic Thanks! |
Hi @jorisvandenbossche, Was the dostring the same for the pandas.DataFrame.rmul and pandas.DataFrame.add example |
Ah, I renamed because the example you fixed was for |
Docstring assigned to the PyData Nairobi chapter for the sprint
Checklist for the pandas documentation sprint
scripts/validate_docstrings.py pandas.DataFrame.rmul
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single pandas.DataFrame.rmul
Please include the output of the validation script below between the "```" ticks:
scripts/validate_docstrings.py pandas.DataFrame.rmul
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.