def duplicates(df, filter_out=True):
    """Operation to filter duplicates, i.e samples with the same geoloc and same specie id."""
    mask = df.duplicated(keep=False)
    if filter_out:
        mask = ~mask
    return df[mask].copy()