-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Update series apply docstring. GH22459 #22510
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
datapythonista
merged 6 commits into
pandas-dev:master
from
eldritchideen:update_series_apply_docstring
Nov 24, 2018
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b17810
DOC: Updated Series.apply docstring. GH22459
eldritchideen 817379f
DOC: Updated wording.
eldritchideen 5baa4fd
DOC: Removed type from **kwds parameter.
eldritchideen d07650f
DOC: Updated Series.apply docstring based on review feedback.
eldritchideen 0eb4e8c
DOC: Removed trailing whitespace.
eldritchideen d5c13b2
Merging from master, and last comments from review addressed
datapythonista 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 |
---|---|---|
|
@@ -3104,17 +3104,19 @@ def apply(self, func, convert_dtype=True, args=(), **kwds): | |
""" | ||
Invoke function on values of Series. Can be ufunc (a NumPy function | ||
that applies to the entire Series) or a Python function that only works | ||
on single values | ||
on single values. | ||
|
||
Parameters | ||
---------- | ||
func : function | ||
convert_dtype : boolean, default True | ||
Python function or NumPy ufunc. | ||
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. may be we can say "Python function or NumPy ufunc to apply."? |
||
convert_dtype : bool, default True | ||
Try to find better dtype for elementwise function results. If | ||
False, leave as dtype=object | ||
False, leave as dtype=object. | ||
args : tuple | ||
Positional arguments to pass to function in addition to the value | ||
Additional keyword arguments will be passed as keywords to the function | ||
Positional arguments to pass to func in addition to the value. | ||
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. "in addition to the value" - can we clarify what that means? |
||
**kwds : | ||
Additional keyword arguments passed to func. | ||
|
||
Returns | ||
------- | ||
|
@@ -3193,8 +3195,6 @@ def apply(self, func, convert_dtype=True, args=(), **kwds): | |
New York 3.044522 | ||
Helsinki 2.484907 | ||
dtype: float64 | ||
|
||
|
||
""" | ||
if len(self) == 0: | ||
return self._constructor(dtype=self.dtype, | ||
|
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.
Can you have a single line description first, and the rest later. You have the documentation about this here:
https://pandas.pydata.org/pandas-docs/stable/contributing_docstring.html
If you run
./scripts/validate_docstrings.py pandas.Series.apply
should report an error about it.