Skip to content

Commit

Permalink
move tuple check case
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Krishna <[email protected]>
  • Loading branch information
naren-ponder committed Jun 1, 2022
1 parent 050793d commit 52b61eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modin/pandas/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,16 @@ def __getitem__(self, key):
"""
if self.df.empty:
return self.df._default_to_pandas(lambda df: df.loc[key])
if isinstance(key, tuple) and key[1] not in self.df.columns:
loc_series = _LocIndexer(self.__getitem__(key[0])).__getitem__(key[1])
loc_series.name = (key[0], key[1])
return loc_series
row_loc, col_loc, ndim = self._parse_row_and_column_locators(key)
self.row_scalar = is_scalar(row_loc)
self.col_scalar = is_scalar(col_loc)

if isinstance(row_loc, Series) and is_boolean_array(row_loc):
return self._handle_boolean_masking(row_loc, col_loc)
if isinstance(key, tuple) and key[1] not in self.df.columns:
loc_series = _LocIndexer(self.__getitem__(key[0])).__getitem__(key[1])
loc_series.name = (key[0], key[1])
return loc_series

row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
result = super(_LocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
Expand Down

0 comments on commit 52b61eb

Please sign in to comment.