Problem 2: Remove Full-Row Duplicates
Easypython
Problem Description
Write a Python program that removes all duplicate rows from a DataFrame, keeping only the first occurrence, and prints the shape before and after.
Input
A DataFrame containing duplicate rows.
Output
The DataFrame's shape before and after removing duplicates.
Constraints
- None specific.
Example Input
text{"id": [1, 2, 3, 1, 2], "value": ["A", "B", "C", "A", "B"]}
Example Output
textBefore: (5, 2) After: (3, 2)
Concepts Covered
drop_duplicates(), shape.