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.
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
- 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
Demo
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prepo-0.1.6.tar.gz.
File metadata
- Download URL: prepo-0.1.6.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d8079040b8cc85004d9f7021cab8279c7916f9e527ac1d0756aaf1502fe26d
|
|
| MD5 |
5a578b4be46f87355c9be5f0070f904a
|
|
| BLAKE2b-256 |
16ffb08cb1625c389ae27da60929b024900cabe4ba1e9c6de6c38a5719eabd9d
|
Provenance
The following attestation bundles were made for prepo-0.1.6.tar.gz:
Publisher:
python-publish.yml on erikhox/prepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prepo-0.1.6.tar.gz -
Subject digest:
c5d8079040b8cc85004d9f7021cab8279c7916f9e527ac1d0756aaf1502fe26d - Sigstore transparency entry: 259870169
- Sigstore integration time:
-
Permalink:
erikhox/prepo@d3e8c0405829a4cb9a120f90255933f68fb20ba3 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/erikhox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3e8c0405829a4cb9a120f90255933f68fb20ba3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prepo-0.1.6-py3-none-any.whl.
File metadata
- Download URL: prepo-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d18b755b53558f350b926e6634c4e5c8deefe96a41263ab34a2787242989d78e
|
|
| MD5 |
a4394b25d7099185a6cf48373b25017e
|
|
| BLAKE2b-256 |
3ab416c1de3eceda99f7ec11663ac742378c946eb685dfe988ea1dc7ccc01557
|
Provenance
The following attestation bundles were made for prepo-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on erikhox/prepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prepo-0.1.6-py3-none-any.whl -
Subject digest:
d18b755b53558f350b926e6634c4e5c8deefe96a41263ab34a2787242989d78e - Sigstore transparency entry: 259870179
- Sigstore integration time:
-
Permalink:
erikhox/prepo@d3e8c0405829a4cb9a120f90255933f68fb20ba3 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/erikhox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3e8c0405829a4cb9a120f90255933f68fb20ba3 -
Trigger Event:
release
-
Statement type: