Skip to content

Commit

Permalink
minor alignment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Mar 10, 2021
1 parent 55321f0 commit 2839b7c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4163,6 +4163,7 @@ def nlargest(self, n, columns, keep="first"):
Column label(s) to order by.
keep : {'first', 'last'}, default 'first'
Where there are duplicate values:
- `first` : prioritize the first occurrence(s)
- `last` : prioritize the last occurrence(s)
Expand Down Expand Up @@ -4225,6 +4226,7 @@ def nsmallest(self, n, columns, keep="first"):
Column name or names to order by.
keep : {'first', 'last'}, default 'first'
Where there are duplicate values:
- ``first`` : take the first occurrence.
- ``last`` : take the last occurrence.
Expand Down
25 changes: 15 additions & 10 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,8 @@ def to_string(self):
4 <NA>
dtype: object
>>> series.to_string()
'0 a\n1 <NA>\n2 b\n3 c\n4 <NA>\ndtype: object'
"""
'0 a\\n1 <NA>\\n2 b\\n3 c\\n4 <NA>\\ndtype: object'
""" # noqa : E501
return self.__repr__()

def __str__(self):
Expand Down Expand Up @@ -2523,6 +2523,7 @@ def drop_duplicates(self, keep="first", inplace=False, ignore_index=False):
----------
keep : {'first', 'last', ``False``}, default 'first'
Method to handle dropping duplicates:
- 'first' : Drop duplicates except for the first occurrence.
- 'last' : Drop duplicates except for the last occurrence.
- ``False`` : Drop all duplicates.
Expand Down Expand Up @@ -3017,11 +3018,12 @@ def astype(self, dtype, copy=False, errors="raise"):
values then may propagate to other cudf objects.
errors : {'raise', 'ignore', 'warn'}, default 'raise'
Control raising of exceptions on invalid data for provided dtype.
- ``raise`` : allow exceptions to be raised
- ``ignore`` : suppress exceptions. On error return original
object.
object.
- ``warn`` : prints last exceptions as warnings and
return original object.
return original object.
Returns
-------
Expand Down Expand Up @@ -3059,7 +3061,7 @@ def astype(self, dtype, copy=False, errors="raise"):
dtype: category
Categories (2, int64): [2 < 1]
Note that using `copy=False`(enabled by default)
Note that using ``copy=False`` (enabled by default)
and changing data on a new Series will
propagate changes:
Expand Down Expand Up @@ -3267,10 +3269,11 @@ def nlargest(self, n=5, keep="first"):
keep : {'first', 'last'}, default 'first'
When there are duplicate values that cannot all fit in a
Series of `n` elements:
- ``first`` : return the first `n` occurrences in order
of appearance.
of appearance.
- ``last`` : return the last `n` occurrences in reverse
order of appearance.
order of appearance.
Returns
-------
Expand Down Expand Up @@ -3319,7 +3322,8 @@ def nlargest(self, n=5, keep="first"):
return self._n_largest_or_smallest(n=n, keep=keep, largest=True)

def nsmallest(self, n=5, keep="first"):
"""Returns a new Series of the *n* smallest element.
"""
Returns a new Series of the *n* smallest element.
Parameters
----------
Expand All @@ -3328,10 +3332,11 @@ def nsmallest(self, n=5, keep="first"):
keep : {'first', 'last'}, default 'first'
When there are duplicate values that cannot all fit in a
Series of `n` elements:
- ``first`` : return the first `n` occurrences in order
of appearance.
of appearance.
- ``last`` : return the last `n` occurrences in reverse
order of appearance.
order of appearance.
Returns
-------
Expand Down

0 comments on commit 2839b7c

Please sign in to comment.