Skip to content
Snippets Groups Projects
Commit 14ffb61c authored by Bert Palm's avatar Bert Palm 🎇
Browse files

indexer bug fix

parent a59cbb9f
No related branches found
No related tags found
No related merge requests found
...@@ -311,7 +311,7 @@ class _aLocIndexer(_Indexer): ...@@ -311,7 +311,7 @@ class _aLocIndexer(_Indexer):
# return a single Series, instead of a dios # return a single Series, instead of a dios
lowdim = False lowdim = False
# dios # dios / df
if _is_dios_like(key): if _is_dios_like(key):
colkey = self._dios.columns.intersection(key.columns) colkey = self._dios.columns.intersection(key.columns)
rowkey = [self._data.at[c].index.intersection(key[c].index) for c in colkey] rowkey = [self._data.at[c].index.intersection(key[c].index) for c in colkey]
...@@ -331,14 +331,14 @@ class _aLocIndexer(_Indexer): ...@@ -331,14 +331,14 @@ class _aLocIndexer(_Indexer):
# column-alignable: list-like, filter only existing columns # column-alignable: list-like, filter only existing columns
elif _is_list_like_not_nested(colkey) and not _is_bool_indexer(colkey): elif _is_list_like_not_nested(colkey) and not _is_bool_indexer(colkey):
colkey = colkey.values if isinstance(colkey, pd.Series) else colkey colkey = colkey.values if isinstance(colkey, pd.Series) else colkey
colkey = [c for c in self._dios.columns if c in colkey] colkey = self._dios.columns.intersection(colkey)
# not alignable # not alignable
# fall back to .loc (boolean list/series, slice(..), ... # fall back to .loc (boolean list/series, slice(..), ...
else: else:
colkey = self._data.loc[colkey].index colkey = self._data.loc[colkey].index
if not colkey: if len(colkey) == 0: # (!) `if not colkey:` fails for pd.Index
return [], [], lowdim return [], [], lowdim
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment