Skip to main content

One-line DataFrame cleaning and EDA for pandas.

Project description

prepx

One-line cleaning and exploratory data analysis for pandas DataFrames.

from prepx import clean, eda

cleaned_df, clean_report = clean(df)
eda_report = eda(cleaned_df, target="price")

Installation

pip install .

clean(df, **kwargs)(DataFrame, dict)

Cleans the DataFrame and returns the cleaned version plus a full action report.

Parameter Default What it does
drop_duplicates True Remove exact duplicate rows
handle_missing "auto" "auto"/"fill" → median/mode fill; "drop" → drop NaN rows; "none" → skip
missing_threshold 0.6 Drop columns with > this fraction missing
fix_dtypes True Coerce object columns to numeric or datetime when ≥80% parse
strip_whitespace True Strip leading/trailing whitespace from strings
standardize_columns True Rename columns to snake_case
remove_outliers False Cap outliers via IQR fences or Z-score
outlier_method "iqr" "iqr" or "zscore"
outlier_threshold 3.0 Z-score cut-off (only used for "zscore")
drop_constant_cols True Drop columns with only one unique value
verbose True Print a human-readable report

Example output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  prepx  ·  Cleaning Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Initial shape                   1000 rows × 12 cols
  Final shape                      961 rows ×  9 cols
  Rows removed                      39
  Columns removed                    3
──────────────────────────────────────────────────────────────

  ✦ Column names → snake_case  (4 renamed)
  ✦ Whitespace stripped  (5 string columns)
  ✦ Type coercion  (2 columns updated)
      Numeric  : age, income
  ✦ Duplicate rows removed  : 12
  ✦ Constant columns dropped : id_copy
  ✦ High-missing columns dropped  (>60% NaN)
      notes
  ✦ Missing values filled  (3 columns)
      age       4 NaN → median (32.0)
      city      2 NaN → mode ('London')

eda(df, **kwargs)dict

Full exploratory analysis. Returns a rich dict and prints a report.

Parameter Default What it does
target None Target column — adds class balance + per-feature correlations
top_n_categories 10 How many top categories to show per object column
correlation_method "pearson" "pearson", "spearman", or "kendall"
verbose True Print a human-readable report

Report dict keys

Key Contents
overview Shape, duplicates, memory
dtypes Column lists by type + per-column dtype
missing Total missing, per-column counts and percentages
numeric_stats Mean, std, min/max, percentiles, skewness, kurtosis, outliers
categorical_stats Unique count, top-N values, mode, entropy
correlations Full matrix + high-correlation pairs (
target_analysis Class balance + feature correlations (if target set)
warnings Auto-generated issues (duplicates, skew, multicollinearity, etc.)

Quick start

import pandas as pd
from prepx import clean, eda

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

# 1 — clean
cleaned, clean_report = clean(df, remove_outliers=True)

# 2 — explore
eda_report = eda(cleaned, target="churn")

# 3 — use the report programmatically
print(eda_report["warnings"])
print(eda_report["numeric_stats"]["age"])

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

prepx-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

prepx-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file prepx-0.1.0.tar.gz.

File metadata

  • Download URL: prepx-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for prepx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2432d883cac8bcaa70181bd45eb4009cb04376b45aeb4b994317395979388bc1
MD5 a51592195f6856d296e1c3ff1b42c644
BLAKE2b-256 75caf7fc1c2d2bc29845217177fc7fa673d3ef5e2f9d328bb45e83f1152e7b3e

See more details on using hashes here.

File details

Details for the file prepx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: prepx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for prepx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07a1c145b336781cdc8ad3e4ce05b3b4e3ba53f625b0e2a167af9198501505ac
MD5 4b518c514b0086235108fb5d749f7d6c
BLAKE2b-256 02b48ebb8ff1c3989ec6cd0f6cd2b50083b80a06d110536819bfc9002fd38ae6

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