def drop_features_without_ranks(self, ranks: Sequence[str], any: bool=False, **kwargs: Any) -> Optional[AnyGenericIdentifier]:
    'Remove features that do not contain `ranks`\n\n        Parameters\n        ----------\n        ranks\n            Ranks to look for\n        any\n            If True removes feature with single occurrence of missing rank.\n            If False all `ranks` must be missing.\n        kwargs\n            Compatibility\n        '
    target_ranks = np.asarray(ranks)
    if (self.__internal_taxonomy.columns.isin(target_ranks).sum() == len(target_ranks)):
        no_rank_mask = self.__internal_taxonomy.loc[:, ranks].isna()
        no_rank_mask_adjusted = (no_rank_mask.any(axis=1) if any else no_rank_mask.all(axis=1))
        ids_to_drop = self.__internal_taxonomy.loc[no_rank_mask_adjusted].index
        return self._remove_features_by_id(ids_to_drop, **kwargs)
    else:
        raise ValueError('Invalid ranks are provided.')
Remove features that do not contain `ranks`

Parameters
----------
ranks
    Ranks to look for
any
    If True removes feature with single occurrence of missing rank.
    If False all `ranks` must be missing.
kwargs
    Compatibility
def drop_features_without_ranks(self, ranks: Sequence[str], any: bool=False, **kwargs: Any) -> Optional[AnyGenericIdentifier]:
    'Remove features that do not contain `ranks`\n\n        Parameters\n        ----------\n        ranks\n            Ranks to look for\n        any\n            If True removes feature with single occurrence of missing rank.\n            If False all `ranks` must be missing.\n        kwargs\n            Compatibility\n        '
    target_ranks = np.asarray(ranks)
    if (self.__internal_taxonomy.columns.isin(target_ranks).sum() == len(target_ranks)):
        no_rank_mask = self.__internal_taxonomy.loc[:, ranks].isna()
        no_rank_mask_adjusted = (no_rank_mask.any(axis=1) if any else no_rank_mask.all(axis=1))
        ids_to_drop = self.__internal_taxonomy.loc[no_rank_mask_adjusted].index
        return self._remove_features_by_id(ids_to_drop, **kwargs)
    else:
        raise ValueError('Invalid ranks are provided.')