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 Mar 16, 2023
1 parent f9d9b5f commit 163cee5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,9 +1327,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 @@ -1339,11 +1339,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 self.__constructor__(
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 163cee5

Please sign in to comment.