def pd_indexing_func(obj): new_obj = obj.iloc[:, indices] if not is_multiple: # If we selected only one param, then remove its columns levels to keep it clean if level_name is not None: if checks.is_frame(new_obj): if isinstance(new_obj.columns, pd.MultiIndex): new_obj.columns = index_fns.drop_levels(new_obj.columns, level_name) return new_obj
def apply_func(obj_index: tp.Index) -> tp.Index: return index_fns.drop_levels(obj_index, levels, strict=strict)
def apply_func(obj_index): return index_fns.drop_levels(obj_index, levels)