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

bookChallenge: Deduplicate a Customer List

Compito

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.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 3
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

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

Scorri per mostrare il menu

Compito

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.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 3
single

single

some-alt