Skip to main content

A beginner-friendly CSV analysis and ML data preparation toolkit

Project description

DipenCSV 🐼

DipenCSV is to pandas what seaborn is to matplotlib — a friendlier, higher-level API.

A beginner-friendly CSV analysis and ML data preparation toolkit built on top of pandas. Helps students and small teams clean, analyze, and prepare CSV data for machine learning — without needing to know pandas.

Who is it for?

  • 🎓 Students cleaning data for ML assignments
  • 🚀 Small startups needing quick data insights
  • 👨‍💻 Developers who work with CSVs occasionally
  • 📊 Anyone who finds pandas too complex

Installation

pip install dipencsv

Quick Start

from dipencsv import Data

data = Data("your_file.csv")
data.magic()  # one click everything

Full ML Workflow in 15 lines

from dipencsv import Data
from sklearn.ensemble import RandomForestClassifier

data = Data("titanic.csv")
data.clean()
data.drop(["passengerid", "name", "ticket", "cabin"])
data.encode("sex")
data.encode("embarked")
data.remove_outliers("fare")
data.normalize("fare")
data.normalize("age")

train, test = data.split(test_size=0.2)

X_train = train.drop("survived", axis=1)
y_train = train["survived"]
X_test = test.drop("survived", axis=1)
y_test = test["survived"]

model = RandomForestClassifier()
model.fit(X_train, y_train)
print(f"Accuracy: {model.score(X_test, y_test):.2f}")
# Accuracy: 0.76

All Commands

Loading

data = Data("file.csv")                        # auto mode
data = Data("bigfile.csv", stream=True)        # force stream mode
data = Data("file.csv", auto_mode=False)       # force pandas mode

Properties

print(data.columns)   # list of column names
print(data.shape)     # (rows, columns)

Understanding Data

data.summary()    # rows, cols, types, missing values
data.report()     # duplicates, missing %, basic stats
data.explain()    # trends, issues, suggestions
data.magic()      # ⭐ one click full analysis

Cleaning

data.clean()                        # auto clean (safe mode)
data.clean(strategy="aggressive")   # drop rows with missing values
data.drop("column")                 # drop one column
data.drop(["col1", "col2"])         # drop multiple columns
data.rename("old_name", "new_name") # rename column
data.fill("column", value)          # fill missing values manually

⚠️ After clean(), column names become lowercase with underscores. Always check: print(data.columns)

ML Preparation

data.encode("gender")           # text → numbers (label encoding)
data.normalize("age")           # scale to [0, 1]
data.standardize("salary")      # scale to mean=0, std=1
data.remove_outliers("price")   # remove extreme values (IQR method)
train, test = data.split(test_size=0.2)  # train/test split

Analytics

data.mean("salary")
data.median("age")
data.max("salary")
data.min("salary")
data.count("city")
data.correlation("age", "salary")
data.correlation_matrix()
data.distribution("salary")
data.outliers("salary")
data.describe()
data.value_counts("city")
data.group_mean("city", "salary")

Querying

data.first()              # first 5 rows
data.first(10)            # first 10 rows
data.last()               # last 5 rows
data.sort("age")          # sort ascending
data.sort("age", asc=False)  # sort descending
data.find("city", "Bangalore")  # find rows by value

Intelligence

data.ask("average salary")
data.ask("top 10 salary")
data.ask("highest salary by city")
data.ask("lowest age")
data.ask("count city")
data.explain()
data.magic()

Export

data.export("output.csv")    # CSV
data.export("output.json")   # JSON
data.export("output.xlsx")   # Excel (requires openpyxl)

Stream Mode (Big Files)

DipenCSV auto detects file size and switches to stream mode for files > 500MB:

data = Data("hugefile.csv")          # auto detects
data = Data("hugefile.csv", stream=True)  # force stream

Supported in stream mode: mean(), max(), min(), count(), group_mean(), filter(), top_n()


Smart Error Handling

data.mean("salry")
# ❌ Column 'salry' not found.
# 💡 Did you mean:
#   - salary
#   - salary_usd

Common Issues

KeyError after clean()

data.clean()
print(data.columns)      # check actual column names
data.mean("salary")      # use lowercase

Excel export failing

pip install openpyxl

Big file crashes

data = Data("bigfile.csv", stream=True)

Dependencies

  • pandas >= 1.5.0
  • scikit-learn >= 1.0.0
  • openpyxl >= 3.0.0 (optional, Excel export)

Documentation

Doc What it covers
Getting Started installation, quick start
Loading Data Data(), auto mode, stream mode
Properties columns, shape
Understanding Data summary, report, explain, magic
Cleaning Data clean, drop, rename, fill
ML Preparation encode, normalize, split etc
Analytics mean, correlation, outliers etc
Query sort, find, first, last
Intelligence ask, explain, magic
Stream Mode big file handling
Export csv, json, xlsx
Examples real world examples
FAQ common student questions
ML Workflow full end-to-end ML example

License

MIT License

Author

Built by Dipendra — a CS student who wanted pandas to be less painful.

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

dipencsv-0.1.3.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

dipencsv-0.1.3-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file dipencsv-0.1.3.tar.gz.

File metadata

  • Download URL: dipencsv-0.1.3.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dipencsv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c09595a11390c91bf1c1faef447b689071f2a9759f6490104124174937cc89cb
MD5 5e2b9ae03343257bc1d2aaf01b452afd
BLAKE2b-256 dda5f7ccd4218c608f9be0e6a3dcd445a636448624cda216ec8730ef5bf0b3e3

See more details on using hashes here.

File details

Details for the file dipencsv-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: dipencsv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dipencsv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b3b968b6a09e52d4631ca71a1f3edb76e8eeb5ec70db22495735b3f994feb9f6
MD5 dcdca9072bed8e982f8277ee9ed0020b
BLAKE2b-256 06f3176a45c19f81027b7d8e51ec84ab8b0cca2ecb12721f207817aafd687889

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