-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: Improve the docstring of Series.take #20179
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
Changes from 1 commit
e3baaff
13c493f
ec2ca5c
af29e7e
85235a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2525,24 +2525,35 @@ def _take(self, indices, axis=0, convert=True, is_copy=True): | |
The axis on which to select elements. "0" means that we are | ||
selecting rows, "1" means that we are selecting columns, etc. | ||
convert : bool, default True | ||
.. deprecated:: 0.21.0 | ||
In the future, negative indices will always be converted. | ||
|
||
Whether to convert negative indices into positive ones. | ||
For example, ``-1`` would map to the ``len(axis) - 1``. | ||
The conversions are similar to the behavior of indexing a | ||
regular Python list. | ||
.. deprecated:: 0.21.0 | ||
In the future, negative indices will always be converted. | ||
is_copy : bool, default True | ||
Whether to return a copy of the original object or not. | ||
kwargs : xxx, default xxx | ||
TODO MUST ADD A REASONABLE DESCRIPTION. | ||
|
||
Returns | ||
------- | ||
taken : type of caller | ||
An array-like containing the elements taken from the object. | ||
|
||
See Also | ||
-------- | ||
numpy.ndarray.take : TODO | ||
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. Return an array formed from the elements at given indices 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. Fix in later commit |
||
numpy.take : TODO | ||
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. Take elements from an array along an axis 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. Fix in later commit |
||
|
||
Examples | ||
-------- | ||
>>> df = pd.DataFrame([('falcon', 'bird', 389.0), | ||
('parrot', 'bird', 24.0), | ||
('lion', 'mammal', 80.5), | ||
('monkey', 'mammal', np.nan)], | ||
columns=('name', 'class', 'max_speed'), | ||
index=[0, 2, 3, 1]) | ||
... ('parrot', 'bird', 24.0), | ||
... ('lion', 'mammal', 80.5), | ||
... ('monkey', 'mammal', np.nan)], | ||
... columns=('name', 'class', 'max_speed'), | ||
... index=[0, 2, 3, 1]) | ||
>>> df | ||
name class max_speed | ||
0 falcon bird 389.0 | ||
|
@@ -2557,6 +2568,7 @@ def _take(self, indices, axis=0, convert=True, is_copy=True): | |
and 3rd rows, not rows whose indices equal 0 and 3. | ||
|
||
>>> df.take([0, 3]) | ||
name class max_speed | ||
0 falcon bird 389.0 | ||
1 monkey mammal NaN | ||
|
||
|
@@ -2576,16 +2588,6 @@ class max_speed | |
name class max_speed | ||
1 monkey mammal NaN | ||
3 lion mammal 80.5 | ||
|
||
Returns | ||
------- | ||
taken : type of caller | ||
An array-like containing the elements taken from the object. | ||
|
||
See Also | ||
-------- | ||
numpy.ndarray.take | ||
numpy.take | ||
""" | ||
|
||
@Appender(_shared_docs['take']) | ||
|
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.
optional keyword arguments to ``:meth:
pandas.compat.numpy.function.validate_take
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.
Fix in later commit