Git Product home page Git Product logo

fuzzy_exact_requiem's Introduction

FuzzyExact

Perform fuzzy matching against two pandas dataframes with optional exact matches.

Requirements

Python 2.7 or higher
Pandas
FuzzyWuzzy
python-Levenshtein (optional)


Installation

pip install fuzzyexact

Usage

import fuzzyexact

remove_punctuation

fuzzyexact.remove_punctuation(df, 'column_name')

remove_punctuation is a helper function which strips all punctuation out of a column in pandas dataframe and returns the cleaned dataframe

clean_address

fuzzyexact.clean_address(df, 'address_column_name')

clean_address is a helper function which cleans an address column of a pandas dataframe by capitalizing, abbreviating road types (street>ST, road>RD), and stripping out building and suite numbers.

fuzzyexact

fuzzyexact.fuzzyexact(df_left, df_right, id_col='Source_ID', key=('first_name', 'address'), block1='state', block2='last_name', threshold=80)

FuzzyExact leverages FuzzyWuzzy's process.extractOne ability, integrates it into pandas dataframes, and enables for up to two exact matches (or blocks) to significantly speed up performance of matching against large datasets. The function returns all rows from df_left along with the best match for each row in df_right. The id_col argument is an optional argument which allows the user to supply an id column from df_right to allow for easier lookups of matched records. The fuzzy match is performed against the key supplied by the user. block1 and block2 are optional arguments which specify exact matches between the two dataframes. The threshold is defaulted to 80, but can be altered by the user and will feed the cutoff to define a "good" match in FuzzyWuzzy's process.extractOne function.

Contact

Project: https://github.com/eric-tomasi/fuzzyexact
Email: [email protected]

Acknowledgments

FuzzyWuzzy

fuzzy_exact_requiem's People

Contributors

eric-tomasi avatar mgar216 avatar etomasi-ds avatar

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.