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

bookChallenge: Fuzzy Match Product Names

Uppgift

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 3
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you explain this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Fuzzy Match Product Names

Svep för att visa menyn

Uppgift

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 desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 3
single

single

some-alt