Code Monkey home page Code Monkey logo

pandas-similarity's Introduction

Pandas Similarity

Generic badge

Pandas similarity is a small library that count and return a similarity index between the entries of a dataframe.

This index can be used to remove very similar observations in a Dataframe. This is useful when you have Dataset coming from different sources about the same subject.

Installing

Install and update using pip:

pip install pandas-similarity

A simple example

IndexCalculator return a normalized index between 0 and 1.

import pandas as pd
from pandas_similarity import IndexCalculator

# Create a Pandas Dataframe.
df = pd.DataFrame([
    [1050, "Ixelles", 0, 360000],
    [1050, "Ixelles", 1, 340000]],
    columns=['postal_code', 'city', 'property_type', 'price'])

# Print the index of similarity between all entries of the dataframe.
print(IndexCalculator(df).get_index())

# Index: 0.6667

In this example, we have a Dataframe with two observations, where price and property_type are different. The similarity index returned by IndexCalculator is 0.667.

About the author

Author: Joffrey Bienvenu, Junior developper & ML student @ Becode.

pandas-similarity's People

Contributors

joffreybvn avatar

Stargazers

 avatar

Watchers

 avatar  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.