Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Myskov <[email protected]>
  • Loading branch information
amyskov committed Sep 3, 2020
1 parent 455275d commit 3bbd0bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion modin/backends/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ def reduce_func(map_results, *args, **kwargs):
def get_value_index(value_result):
alloc = value_result.groupby(level=0).get_group("allocation")
ind = value_result.groupby(level=0).get_group("index")
# print("alloc\n", alloc)
if 0 in alloc.values:
return ind[alloc.values == 0]
assert alloc.nunique(dropna=False) == 1
Expand Down
4 changes: 4 additions & 0 deletions modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,10 @@ def replace(
return self._create_or_update_from_compiler(new_query_compiler, inplace)

def searchsorted(self, value, side="left", sorter=None):
if sorter is not None:
self.index = sorter
self.sort_index(inplace=True)
sorter = None
result = self.__constructor__(
query_compiler=self._query_compiler.searchsorted(
value=value, side=side, sorter=sorter
Expand Down
6 changes: 3 additions & 3 deletions modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def create_test_series(vals, sort=False):
modin_series = pd.Series(vals)
pandas_series = pandas.Series(vals)
if sort:
modin_series = modin_series.sort_values()
pandas_series = pandas_series.sort_values()
modin_series = modin_series.sort_values().reset_index(drop=True)
pandas_series = pandas_series.sort_values().reset_index(drop=True)
return modin_series, pandas_series


Expand Down Expand Up @@ -2628,7 +2628,7 @@ def test_searchsorted(data, side, values_number, sorter):
min_sammple = modin_series.min(skipna=True)
max_sammple = modin_series.max(skipna=True)

exact_values = modin_series.sample(n=values_number)
exact_values = list(modin_series.sample(n=values_number))
mean_values = np.random.uniform(
low=min_sammple, high=max_sammple, size=values_number
)
Expand Down

0 comments on commit 3bbd0bc

Please sign in to comment.