Skip to main content

A python package for simple data imputation

Project description

What does it do?

Have you ever had a time when your missing data was holding you back? Well then this package is for you!

Our python package for simple data imputation will allow you to quickly and seamlessly impute any missing data (be numeric, categorical, date/time or boolean values) using any large datasets.

All you have to do is follow these simple 4 steps:

  1. Import the package and the data you wish you impute
  2. Select the function and method for imputation (this will depend on the data type - read the usage section below for more details)
  3. Hit run
  4. Save your newly imputed dataset

Our package will help simplify all your imputation needs so your data is ready when you need it!

Contributors & Maintainers

Installation

$ pip install simpute_py

Usage and Examples

We have four main functions dealing with each data type:

  • Num_imputer: This function fills in the empty values of a numeric column with values derived from your selected imputation method. Your options for method include knn (autogenerated values based on KNN), mean, median and mode.
  • Cat_imputer: This function fills in the empty values of a categorical column with values derived based on most frequent (mode) category.
  • Bol_imputer: This function fills in the empty values of a boolean column with values derived using most frequent (mode) boolean value.
  • Date_imputer: This function fills in empty values of a date column with median point of the range of dates in that column.

To get started first install our imputation functions:

from simpute_py.bol_imputer import bol_imputer #For imputing on boolean columns
from simpute_py.cat_imputer import cat_imputer #For imputing on categorical columns
from simpute_py.date_imputer import date_imputer #For imputing on date columns
from simpute_py.num_imputer import num_imputer #For imputing on numerical columns

To run to the function, simply enter the following:

import pandas as pd

#Load test data from home directory
test_df = pd.read_csv('tests/tesla_deaths_mini.csv')

#Test functions
test_df = bol_imputer(test_df, "Driver")
test_df = cat_imputer(test_df, "Country")
test_df = date_imputer(test_df, "Date")
test_df = num_imputer(test_df, "Deaths")

print(test_df)

Place in the Python Ecosystem

Currently, there are many other ways you can impute a dataset, using various functions build within Python, but this packages it neatly into one place and simplifies the process. We do have other packages you can use such as AutoImpute and MIDASpy. However our package aims to provide functionality not provided in either package and for more general audience use.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

simpute_py was created by Lisa Sequeira, Renee Kwon, Fujie Sun, and Ken Wang. It is licensed under the terms of the MIT license.

Credits

simpute_py was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpute_py-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpute_py-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file simpute_py-0.1.1.tar.gz.

File metadata

  • Download URL: simpute_py-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for simpute_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 695e56ce17a4e32b655b2e5ab4b8c9889b93d83fd04f6f15c88d6821a3786291
MD5 d50ac0e48414558772d1745af10032a8
BLAKE2b-256 50633a2ef2d246b5bed1f915b2c976690edd977d8b8d6c768a85d26514e9b009

See more details on using hashes here.

File details

Details for the file simpute_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simpute_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for simpute_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc389a4cfe49fb18a35ad58b652e7ced93762c3788dcf46c8eb36038cc6fdab2
MD5 fbc269d0f7710cb56e8d92b813d6386e
BLAKE2b-256 3e3a15528e983e248733b568862eb7b441764836306f15419377a852aa0321f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page