AlloViz.AlloViz.Elements.Element._drop_labels_or_levels¶
- Element._drop_labels_or_levels(keys, axis: int = 0)¶
Drop labels and/or levels for the given axis.
- For each key in keys:
(axis=0): If key matches a column label then drop the column. Otherwise if key matches an index level then drop the level.
(axis=1): If key matches an index label then drop the row. Otherwise if key matches a column level then drop the level.
- Parameters:
- keysstr or list of str
labels or levels to drop
- axisint, default 0
Axis that levels are associated with (0 for index, 1 for columns)
- Returns:
- dropped: DataFrame
- Raises:
- ValueError
if any keys match neither a label nor a level