Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Deduplicate a Customer List | Deduplication Strategies
Quizzes & Challenges
Quizzes
Challenges
/
Data Cleaning Techniques in Python

bookChallenge: Deduplicate a Customer List

Aufgabe

Swipe to start coding

You are given a list of customer records that contains duplicate entries. Each customer is represented as a dictionary with two fields:

  • name — the customer's full name;
  • email — the email address provided by the customer.

Your goal is to remove duplicate records using a simple matching rule.

Follow these steps:

  1. Two records are considered duplicates if their email fields match exactly.
  2. Create an empty dictionary named unique_customers, where keys are email addresses and values are customer dictionaries.
  3. Loop through the input list customers and add only the first occurrence of each email to unique_customers.
  4. Store the deduplicated list in a new variable named deduplicated_list, which should contain only the unique customer dictionaries (values of unique_customers).

Make sure both unique_customers and deduplicated_list are declared and contain the correct deduplicated data.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 3
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

bookChallenge: Deduplicate a Customer List

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

You are given a list of customer records that contains duplicate entries. Each customer is represented as a dictionary with two fields:

  • name — the customer's full name;
  • email — the email address provided by the customer.

Your goal is to remove duplicate records using a simple matching rule.

Follow these steps:

  1. Two records are considered duplicates if their email fields match exactly.
  2. Create an empty dictionary named unique_customers, where keys are email addresses and values are customer dictionaries.
  3. Loop through the input list customers and add only the first occurrence of each email to unique_customers.
  4. Store the deduplicated list in a new variable named deduplicated_list, which should contain only the unique customer dictionaries (values of unique_customers).

Make sure both unique_customers and deduplicated_list are declared and contain the correct deduplicated data.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 3
single

single

some-alt