import pandas as pd
# Create a DataFrame from the sample data
data = {
'Duration': [30, 45, 30, 30, 45],
'Date': ['2024-11-01', '2024-11-01', '2024-11-02', '2024-11-01', '2024-11-03'],
'Pulse': [75, 80, 75, 75, 80],
'MaxPulse': [150, 155, 150, 150, 155],
'Calories': [250, 300, 250, 250, 310]
}
df = pd.DataFrame(data)
# Check for duplicate rows in the entire DataFrame
duplicates = df[df.duplicated()]
# Display duplicate entries
print("Duplicate entries in the dataset:")
print(duplicates)
# If you want to find duplicates based on specific columns (e.g., 'Date', 'Pulse', 'MaxPulse'):
duplicates_specific_columns = df[df.duplicated(subset=['Date', 'Pulse', 'MaxPulse', 'Calories'])]
print("\nDuplicates based on specific columns:")
print(duplicates_specific_columns)
# Optionally, show all duplicates (including the first occurrence)
all_duplicates = df[df.duplicated(keep=False)]
print("\nAll duplicate entries (including first occurrence):")
print(all_duplicates)
aW1wb3J0IHBhbmRhcyBhcyBwZAoKIyBDcmVhdGUgYSBEYXRhRnJhbWUgZnJvbSB0aGUgc2FtcGxlIGRhdGEKZGF0YSA9IHsKICAgICdEdXJhdGlvbic6IFszMCwgNDUsIDMwLCAzMCwgNDVdLAogICAgJ0RhdGUnOiBbJzIwMjQtMTEtMDEnLCAnMjAyNC0xMS0wMScsICcyMDI0LTExLTAyJywgJzIwMjQtMTEtMDEnLCAnMjAyNC0xMS0wMyddLAogICAgJ1B1bHNlJzogWzc1LCA4MCwgNzUsIDc1LCA4MF0sCiAgICAnTWF4UHVsc2UnOiBbMTUwLCAxNTUsIDE1MCwgMTUwLCAxNTVdLAogICAgJ0NhbG9yaWVzJzogWzI1MCwgMzAwLCAyNTAsIDI1MCwgMzEwXQp9CgpkZiA9IHBkLkRhdGFGcmFtZShkYXRhKQoKIyBDaGVjayBmb3IgZHVwbGljYXRlIHJvd3MgaW4gdGhlIGVudGlyZSBEYXRhRnJhbWUKZHVwbGljYXRlcyA9IGRmW2RmLmR1cGxpY2F0ZWQoKV0KCiMgRGlzcGxheSBkdXBsaW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