Skip to content

Commit

Permalink
Fix nlargest and nsmallest Series support (modin-project#46) (core)
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Krishna <[email protected]>
  • Loading branch information
naren-ponder authored and vnlitvinov committed Feb 13, 2023
1 parent 00f126b commit ba7ba0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,9 +1290,9 @@ def nlargest(self, n=5, keep="first"): # noqa: PR01, RT01, D200
raise NotImplementedError(
"Series.nlargest is not implemented for empty Series."
)
return DataFrame(
return Series(
query_compiler=self._query_compiler.nlargest(
n, [self._query_compiler.columns[0]], keep
n=n, columns=self.name, keep=keep
)
)

Expand All @@ -1302,11 +1302,11 @@ def nsmallest(self, n=5, keep="first"): # noqa: PR01, RT01, D200
"""
if len(self._query_compiler.columns) == 0:
raise NotImplementedError(
"Series.nlargest is not implemented for empty Series."
"Series.nsmallest is not implemented for empty Series."
)
return DataFrame(
return Series(
query_compiler=self._query_compiler.nsmallest(
n, [self._query_compiler.columns[0]], keep
n=n, columns=self.name, keep=keep
)
)

Expand Down

0 comments on commit ba7ba0b

Please sign in to comment.