Skip to content

Commit

Permalink
FIX-modin-project#2566: Reduce unique dimensions using constructor in…
Browse files Browse the repository at this point in the history
…stead

Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
  • Loading branch information
richardlin047 committed Dec 23, 2020
1 parent 87df768 commit 0148c13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,9 @@ def truncate(self, before=None, after=None, axis=None, copy=True):
)

def unique(self):
# Ensure we don't return a scalar to match shape of Panda's output
return np.atleast_1d(self._query_compiler.unique().to_numpy().squeeze())
return self.__constructor__(
query_compiler=self._query_compiler.unique()
).to_numpy()

def update(self, other):
if not isinstance(other, Series):
Expand Down

0 comments on commit 0148c13

Please sign in to comment.