Skip to main content

A comprehensive data preprocessing library for Python

Project description

PreprocessingLib PreprocessingLib is a Python library designed to facilitate data preprocessing steps. It provides various classes and functions to automate the process of cleaning, transforming, and engineering features in datasets.

Features

  1. Missing Value Handling Detect missing values in a dataset. Fill missing values using mean, median, or a constant value. Remove rows or columns with missing values.
  2. Feature Engineering Create new features based on existing ones.
  3. Date and Time Handling Extract features like year, month, day, and day of the week from datetime columns.
  4. Data Type Conversion Convert columns to numeric or categorical data types.
  5. Categorical Encoding Perform one-hot encoding or label encoding on categorical variables.
  6. Outlier Handling Detect outliers in numerical data. Handle outliers by removing or replacing them.
  7. Data Scaling Standardize or normalize numerical data.
  8. Text Cleaning Clean text data by removing punctuation, stop words, and lemmatizing words. Installation You can install PreprocessingLib using pip:

pip install preprocessinglib Usage Here's how you can use PreprocessingLib in your Python projects:

from mypreprocessinglib import FeatureEngineer, MissingValueHandler, DateTimeHandler, DataTypeConverter, CategoricalEncoder, OutlierHandler, Scaler, TextCleaner import pandas as pd

Load sample dataset

data = pd.read_csv("sample_dataset.csv")

Example usage of preprocessing functions

missing_handler = MissingValueHandler() filled_data = missing_handler.fill_missing_values(data)

data_with_new_features = FeatureEngineer.create_new_features(data, column1='Column1', column2='Column2')

date_with_features = DateTimeHandler.extract_date_features(data, column='DateColumn')

numeric_data = DataTypeConverter.convert_to_numeric(data, columns=['Column1', 'Column2'])

encoded_data = CategoricalEncoder.one_hot_encode(data, columns=['CategoricalColumn'])

outliers_removed_data = OutlierHandler.handle_outliers(data, method='drop')

scaled_data = Scaler.standardize_data(data)

cleaned_text = TextCleaner.clean_text("example text") Testing You can run the unit tests to ensure the proper functioning of the library:

python -m unittest test_data_preprocessing.py Contributing Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

preprocessinglib-0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

preprocessinglib-0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file preprocessinglib-0.1.tar.gz.

File metadata

  • Download URL: preprocessinglib-0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for preprocessinglib-0.1.tar.gz
Algorithm Hash digest
SHA256 64020607f51e98a09e412052d68233c7ee86494183e21ad770590e6a666db220
MD5 2b8a81e4ae6d1dd2b39899c30439bf68
BLAKE2b-256 c8f3674acb0798c300017e3b21f5d163fcc416f91d9b22d1769366f38f655b3f

See more details on using hashes here.

File details

Details for the file preprocessinglib-0.1-py3-none-any.whl.

File metadata

  • Download URL: preprocessinglib-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for preprocessinglib-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16c74c3866244353692c9208bec39a73cff104ee49cc6c166e3a972014a6a3e3
MD5 23abffe217b9039e4656a2f05e723e1f
BLAKE2b-256 ebe51ce95c8186e889949f8d7192484b05a0c27e55b3d0220d97578c77d4fa8d

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