Skip to content

DOC: Clean sort_values and sort_index docstrings #24843

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 12 commits into from
Jan 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean docstrings
* Add periods

* Realign descriptions
  • Loading branch information
Daniel Saxton committed Jan 22, 2019
commit 73a911e19738b7807cd15debdde510ea68c3a63a
28 changes: 14 additions & 14 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3966,25 +3966,25 @@ def add_suffix(self, suffix):
def sort_values(self, by=None, axis=0, ascending=True, inplace=False,
kind='quicksort', na_position='last'):
"""
Sort by the values along either axis
Sort by the values along either axis.

Parameters
----------%(optional_by)s
axis : %(axes_single_arg)s, default 0
Axis to be sorted
Axis to be sorted.
ascending : bool or list of bool, default True
Sort ascending vs. descending. Specify list for multiple sort
orders. If this is a list of bools, must match the length of
the by.
inplace : bool, default False
If True, perform operation in-place
If True, perform operation in-place.
kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'
Choice of sorting algorithm. See also ndarray.np.sort for more
information. `mergesort` is the only stable algorithm. For
DataFrames, this option is only applied when sorting on a single
column or label.
na_position : {'first', 'last'}, default 'last'
`first` puts NaNs at the beginning, `last` puts NaNs at the end
Puts NaNs at the beginning if `first`; `last` puts NaNs at the end.

Returns
-------
Expand Down Expand Up @@ -4056,28 +4056,28 @@ def sort_values(self, by=None, axis=0, ascending=True, inplace=False,
def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
kind='quicksort', na_position='last', sort_remaining=True):
"""
Sort object by labels (along an axis)
Sort object by labels (along an axis).

Parameters
----------
axis : %(axes)s to direct sorting
level : int or level name or list of ints or list of level names
If not None, sort on values in specified index level(s)
If not None, sort on values in specified index level(s).
ascending : boolean, default True
Sort ascending vs. descending
Sort ascending vs. descending.
inplace : bool, default False
If True, perform operation in-place
kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'
Choice of sorting algorithm. See also ndarray.np.sort for more
information. `mergesort` is the only stable algorithm. For
DataFrames, this option is only applied when sorting on a single
column or label.
Choice of sorting algorithm. See also ndarray.np.sort for more
information. `mergesort` is the only stable algorithm. For
DataFrames, this option is only applied when sorting on a single
column or label.
na_position : {'first', 'last'}, default 'last'
`first` puts NaNs at the beginning, `last` puts NaNs at the end.
Not implemented for MultiIndex.
Puts NaNs at the beginning if `first`; `last` puts NaNs at the end.
Not implemented for MultiIndex.
sort_remaining : bool, default True
If True and sorting by level and index is multilevel, sort by other
levels too (in order) after sorting by specified level
levels too (in order) after sorting by specified level.

Returns
-------
Expand Down