rnalysis.filtering.Filter.filter_duplicate_ids๏
- Filter.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.