Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Fuzzy Match Product Names | Fuzzy Matching and Similarity Detection
Quizzes & Challenges
Quizzes
Challenges
/
Data Cleaning Techniques in Python

bookChallenge: Fuzzy Match Product Names

Oppgave

Swipe to start coding

You are given two lists of product names:

  • catalog_names — the official catalog entries;
  • incoming_names — names provided by an external supplier with slight variations.

Your goal is to assign each supplier product name to the closest matching catalog name using the difflib library from the Python standard library.

Follow these steps:

  1. For each element of incoming_names, compare it with every element of catalog_names.
  2. Use the SequenceMatcher class from the difflib module to calculate similarity scores.
  3. For each incoming name, find the catalog entry with the highest similarity score.
  4. Store all matches in a dictionary named matched_products, where keys are supplier names and values are the closest catalog names.

Make sure that the variable matched_products is declared and contains the correct matches.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 3
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Fuzzy Match Product Names

Sveip for å vise menyen

Oppgave

Swipe to start coding

You are given two lists of product names:

  • catalog_names — the official catalog entries;
  • incoming_names — names provided by an external supplier with slight variations.

Your goal is to assign each supplier product name to the closest matching catalog name using the difflib library from the Python standard library.

Follow these steps:

  1. For each element of incoming_names, compare it with every element of catalog_names.
  2. Use the SequenceMatcher class from the difflib module to calculate similarity scores.
  3. For each incoming name, find the catalog entry with the highest similarity score.
  4. Store all matches in a dictionary named matched_products, where keys are supplier names and values are the closest catalog names.

Make sure that the variable matched_products is declared and contains the correct matches.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 3
single

single

some-alt