Giter Site home page Giter Site logo

oscarm417 / fuzzy-data-matching Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 40 KB

This package helps identify and remove duplicate records from large data sets. Additionally, you can adjust the similarity of thresholds, to identify approximate matches. This was created for identifying duplicate submissions for class action lawsuits. Hope this helps you clean your data sets, identify duplicate records, or standardize data.

Python 18.47% Jupyter Notebook 81.53%

fuzzy-data-matching's Introduction

Fuzzy-Data-Matching

This package helps identify and remove duplicate records from large data sets. Additionally, you can adjust the similarity of thresholds, to identify approximate matches. This was created for identifying duplicate submissions for class action lawsuits. Hope this helps you clean your data sets, identify duplicate records, or standardize data.

Example 1: 

Assume file name is called "hireMe.xlsx" and "peopleHired.xlsx" exist. We want to identify who got hired, but data entry may not be perfect

hireMe = pd.read_excel("hireMe.xlsx", dtype =str).fillna("")
hired = pd.read_excel("peopleHired.xslx", dtype =str).fillna("")
duplicateRecordsMatched = fuzzy_compare_dataframes(hireMe, hired, deduping_cols1 = ['Name','Email','Address'],deduping_cols2 = ['Name','Email','Address'], fuzzy_percentage = .95)

#This will give you the duplicate records, based on the 95% match. 


Example 2: 
Lets say we want to identify people that submited multiple submissions to a settlement that only allows one submission per person. 
In many instances, people trying to submit many times, will submit many times with very small changes, as so to be considered different people, 
but still be able to cash the checks.

df = pd.read_excel("submissions.xlsx", dtype =str).fillna("")
duplicateRecordsMarked = fuzzy_dedupe_main(df,deduping_cols1 = ['FirstName','LastName'],percent_match = .9)

At this point all duplicate records will be matched with a unique id, and a rank value. The rank value identies the order in which that duplicate record was found. 
So the first duplicate record will be marked as Rank = 1

Duplicate records can then be removed with the following command

cleanedDf = duplicateRecordsMarked[duplicateRecordsMarked['Rank']==1]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.