Skip to content

BUG: duplicated() is reporting rows as duplicates when they aren't upon visual inspection. #61312

@nvd2291

Description

@nvd2291

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

I got the creditcard.csv from Kaggle: https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud 

import pandas as pd
import numpy as np

credit_card_df = pd.read_csv('creditcard.csv')

duplicated_df = credit_card_df[credit_card_df.duplicated()]

duplicated_df

Issue Description

If you look at the output of the duplicated_df you can see rows 33 and 35 reported as duplicates when they aren't. The values are close but not exact duplicates

Expected Behavior

Would expect these rows to not be reported as duplicates because the values in the columns that aren't named 'Time' are not identical to each other.

Installed Versions

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugClosing CandidateMay be closeable, needs more eyeballsNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions