Skip to content
C

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

text
Before: (5, 2) After: (3, 2)

Concepts Covered

drop_duplicates(), shape.

Input (stdin)

Output

Run your code to see output here...