From 1a4aecb07a71be5b7514094e454eb7274caf3be6 Mon Sep 17 00:00:00 2001 From: John Victor Kew II Date: Fri, 5 May 2023 07:56:07 -0700 Subject: [PATCH] REMOVE the masking approach .loc using arrays of booleans ( now entirely w/in pushdown code ) (#40) [no upstream] * Simplify the masking approach to .loc * Remove iloc hack code for loc support --- modin/pandas/indexing.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/modin/pandas/indexing.py b/modin/pandas/indexing.py index 64011f87082..d059d9726ed 100644 --- a/modin/pandas/indexing.py +++ b/modin/pandas/indexing.py @@ -633,25 +633,6 @@ def __getitem__(self, key): if self.df.empty: return self.df._default_to_pandas(lambda df: df.loc[key]) - # Limited support for slicing operations on loc, and predominantly - # only with positional mapping by translating it to an iloc. To - # support proper labels (sorted) we will need to translate the - # existing index to a mask OR translate the expression to a set of - # predicates. - if is_slice(key): - if key.step is not None: - raise NotImplementedError("Slice with step not supported for loc") - if key.start is None and key.stop is None: - return self.df - if key.start is None: - arr = (self.df.index <= key.stop) - return self.df.iloc[ arr ] - if key.stop is None: - arr = (self.df.index >= key.start) - return self.df.iloc[ arr ] - # Works for a positional mapping - return self.df.iloc[ key.start : ( key.stop + 1) ] - if ( isinstance(key, tuple) and len(key) == 2 @@ -1010,7 +991,6 @@ def __getitem__(self, key): col_scalar = is_scalar(col_loc) self._check_dtypes(row_loc) self._check_dtypes(col_loc) - if isinstance(row_loc, Series) and is_boolean_array(row_loc): return self._handle_boolean_masking(row_loc, col_loc)