Skip to main content

A package for preprocessing pandas DataFrames

Project description

Prepo

A Python package for preprocessing pandas DataFrames, with a focus on automatic data type detection, cleaning, and scaling.

Features

  • Automatic Data Type Detection: Automatically identifies column types (numeric, categorical, temporal, etc.)
  • Data Cleaning: Handles missing values, standardizes null representations
  • Outlier Removal: Identifies and removes outliers from numeric columns
  • Feature Scaling: Supports multiple scaling methods (standard, robust, minmax)
  • Time Series Detection: Identifies if a DataFrame represents time series data

Installation

pip install prepo

Usage

import pandas as pd
from prepo import FeaturePreProcessor

# Create a processor instance
processor = FeaturePreProcessor()

# Load your data
df = pd.read_csv('data/raw/your_data.csv')

# Process the data
processed_df = processor.process(
    df, 
    drop_na=True,           # Drop rows with missing values
    scaler_type='standard', # Scale numeric features using standard scaling
    remove_outlier=True     # Remove outliers
)

# Save the processed data
processed_df.to_csv('data/processed/processed_data.csv', index=False)

Data Type Detection

The package automatically detects the following data types:

  • temporal: Date and time columns
  • binary: Columns with only two unique values
  • percentage: Columns with values between 0 and 1, or columns with names containing "perc", "rating", etc.
  • price: Columns with names containing "price", "cost", "revenue", etc.
  • id: Columns with names ending or starting with "id"
  • numeric: General numeric columns
  • integer: Numeric columns with integer values
  • categorical: Columns with a low ratio of unique values to total values
  • string: Short text columns
  • text: Long text columns

Project Structure

prepo/
├── data/               # Data directory
│   ├── raw/            # Raw data files
│   ├── processed/      # Processed data files
│   └── test/           # Test data files
├── src/                # Source code
│   └── prepo/          # Main package
│       ├── __init__.py        # Package initialization
│       └── preprocessor.py    # Core preprocessing functionality
├── tests/              # Test directory
│   ├── __init__.py     # Test package initialization
│   └── test_preprocessor.py  # Tests for preprocessor
├── examples/           # Example scripts
│   └── basic_usage.py  # Basic usage example
├── README.md           # Project documentation
├── LICENSE             # License information
└── setup.py            # Package installation script

License

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

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

prepo-0.1.5.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

prepo-0.1.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file prepo-0.1.5.tar.gz.

File metadata

  • Download URL: prepo-0.1.5.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for prepo-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fff10b91f38664599ac95b08e64706d83a3c04ab482643ab084ce4356781416f
MD5 7c7db5f7908d9c23652dd2b236067558
BLAKE2b-256 b334edd22dbef5a9efc8ae362f08e7ffed3c88b0714b0093e2c618e1624b0044

See more details on using hashes here.

Provenance

The following attestation bundles were made for prepo-0.1.5.tar.gz:

Publisher: python-publish.yml on erikhox/prepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prepo-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: prepo-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for prepo-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 223661f468db61876b53f76e1a943d50ec7cbc8eec1e881ea2dbbcb7978630a6
MD5 37af113b5bd2c3e6dabf853acbdbc9b5
BLAKE2b-256 bcc092afb536d518a37b150b24c4e345a501ac877df34bc20e15ae2b2d49b26f

See more details on using hashes here.

Provenance

The following attestation bundles were made for prepo-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on erikhox/prepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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