rnalysis.filtering.CountFilter.filter_duplicate_ids

CountFilter.filter_duplicate_ids(keep: Literal['first', 'last', 'neither'] = 'first', opposite: bool = False, inplace: bool = True)

Filter out rows with duplicate names/IDs (index).

Parameters
  • keep ('first', 'last', or 'neither' (default='first')) – determines which of the duplicates to keep for each group of duplicates. ‘first’ will keep the first duplicate found for each group; ‘last’ will keep the last; and ‘neither’ will remove all of the values in the group.

  • opposite (bool) – If True, the output of the filtering will be the OPPOSITE of the specified (instead of filtering out X, the function will filter out anything BUT X). If False (default), the function will filter as expected.

  • inplace (bool (default=True)) – If True (default), filtering will be applied to the current Filter object. If False, the function will return a new Filter instance and the current instance will not be affected.

Returns

If inplace is False, returns a new and filtered instance of the Filter object.