Skip to main content

DataPrepKit_AO_v1.0

DataPrepKit_AO_v1.0 is a Python library designed for efficient data preprocessing. It provides a comprehensive set of tools to clean, transform, and prepare your data for machine learning or analysis. This kit allows you to understand your dataset better and get it ready for modeling.

Features

  • Data Summary (data_summary): Get a detailed overview of your dataset:
    • Shape (rows, columns)
    • Missing value counts per column
    • Unique value counts per column
    • Descriptive statistics (mean, median, mode, standard deviation, minimum, maximum) for numerical columns
    • Value counts for non-numerical columns
  • Encoding Categorical Features (encode_categorical):
    • Label Encoding: Convert categorical values into numerical labels.
    • Ordinal Encoding: Encode categories in a specific order (if an order is inherent in your data).
    • One-Hot Encoding: Create dummy variables for each category.
  • Scaling Numerical Features (scale_data):
    • Standard Scaling: Center data around mean 0 with standard deviation 1.
    • Min-Max Scaling: Rescale features to a range of 0 to 1.
    • Robust Scaling: Scaling less affected by outliers, using median and IQR.
    • Normalization: Scale each sample (row) to have unit norm (length of 1).
  • Imputation of Missing Values (impute_data):
    • Dropping Missing Values: Remove rows with missing values.
    • Mean/Median/Most Frequent Imputation: Fill missing values using central tendency measures.
    • Constant Value Imputation: Fill with a user-specified constant.
    • K-Nearest Neighbors (KNN) Imputation: Use the values of nearest neighbors to fill in missing data.
    • Iterative Imputation: A more advanced method that models each feature with missing values as a function of other features.
  • Dropping Rows and Columns (drop): Remove specified rows or columns from your DataFrame.

Installation

pip install pandas numpy scikit-learn

Usage

import pandas as pd
from dataprepkit.data_prep_kit import DataPrepKit

# Load data
data = pd.read_csv('your_data.csv') 
data_prep = DataPrepKit(data=data)

# Data understanding
data_prep.data_summary()

# Encoding 
data_prep.encode_categorical(columns=['your_categorical_column'], method='one-hot')

# Scaling
data_prep.scale_data(columns=['your_numerical_column'], method='standard')

# Imputation
data_prep.impute_data(columns=['column_with_missing_values'], method='mean')

# Dropping data
data_prep.drop(columns=['unwanted_column'])
data_prep.drop(rows=[0, 5]) # Drop specific rows 

# Access the processed data
processed_df = data_prep.data

Error Handling

The library includes checks for:

  • Missing columns: KeyError is raised if you try to operate on columns not in your DataFrame.
  • Invalid method names: ValueError if you specify an incorrect encoding, scaling, or imputation method.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions, please contact abdalrahman.osama01@gmail.com.

Metadata

Release files for dataprepkit-ao 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dataprepkit-ao 1.0.0
File Size Uploaded Provenance Actions
dataprepkit-ao-1.0.0.tar.gz 6.8 kB Without provenance Details for dataprepkit-ao-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dataprepkit-ao 1.0.0
File Interpreter ABI Platform Actions
dataprepkit_ao-1.0.0-py3-none-any.whl Python 3 none any Details for dataprepkit_ao-1.0.0-py3-none-any.whl

Total release size: 14.4 kB

Release files / dataprepkit-ao-1.0.0.tar.gz

Download URL dataprepkit-ao-1.0.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
57c0567bc669da997682aa0defff30b3cbb64f2f8ca96d47d94e475dd5b39fec
BLAKE2b-256 checksum
How to use checksums
961f60e4e9dd29766f6f0108ff4e4c741c3e8f25fa236d0ad0a85e859af5f6cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release files / dataprepkit_ao-1.0.0-py3-none-any.whl

Download URL dataprepkit_ao-1.0.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e681934b964d6ed4c8cb52ea4ef82281fd15e272ddefb3faef2bb5b11e7f25cb
BLAKE2b-256 checksum
How to use checksums
faf6fb70b6186ca07cca5bdde9bcad71bae8007da03511a1b1a7b53cbb6768f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Security for dataprepkit-ao 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page