Skip to main content

Complexifier

Make your pandas even worse!

Problem

When teaching students to work with data, an important lesson is how to clean it.

The problem with this is that there are two types of datasets available on the internet:

  1. Data that is good, but already cleaned
  2. Data that is not cleaned, but is terrible and incomprehensible

Complexifier solves this problem by allowing you take the former and turn it into a better version of the latter!

Dependencies

  • pandas
  • typo
  • random

Installation

complexifier can be installed using pip

pip install complexifier

Documentation

Go to the documentation

Usage

Once installed you can use complexifier to add mistakes and outliers to your data

This library has several methods available:

create_spag_error

create_spag_error(word: str) -> str

Introduces a 10% chance of a random spelling error in a given word. This function is useful for simulating typos and spelling mistakes in text data.

introduce_spag_error

introduce_spag_error(df: pd.DataFrame, columns=None) -> pd.DataFrame

Applies the create_spag_error function to each string entry in specified columns of a DataFrame, introducing random spelling errors with a 10% probability.

add_or_subtract_outliers

add_or_subtract_outliers(df: pd.DataFrame, columns=None) -> pd.DataFrame

Randomly adds or subtracts values in specified numeric columns at random indices, simulating outliers between 1% and 10% of the rows.

add_standard_deviations

add_standard_deviations(df: pd.DataFrame, columns=None, min_std=1, max_std=5) -> pd.DataFrame

Adds between 1 to 5 standard deviations to random entries in specified numeric columns to simulate data anomalies.

duplicate_rows

duplicate_rows(df: pd.DataFrame, sample_size=None) -> pd.DataFrame

Introduces duplicate rows into a DataFrame. This function is useful for testing deduplication processes.

add_nulls

add_nulls(df: pd.DataFrame, columns=None, min_percent=1, max_percent=10) -> pd.DataFrame

Inserts null values into specified DataFrame columns. This simulates missing data conditions.

mess_it_up

mess_it_up(df: pd.DataFrame, columns=None, min_std=1, max_std=5, sample_size=None,min_percent=1, max_percent=10, introduce_spag=True, add_outliers=True, add_std=True, duplicate=True, add_null=True) -> pd.DataFrame

Adds all (or some) of the above methods. Really messes it up.

Metadata

Release files for complexifier 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for complexifier 1.0.0
File Size Uploaded
complexifier-1.0.0.tar.gz 443.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for complexifier 1.0.0
File Interpreter ABI Platform
complexifier-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 450.1 kB

Release files / complexifier-1.0.0.tar.gz

Download URL complexifier-1.0.0.tar.gz
Size 443.0 kB
Tags Source
SHA-256 checksum
How to use checksums
541548994eeade00ea1198679ca163a6298435457ed5a9df602c5d605cb6b673
BLAKE2b-256 checksum
How to use checksums
d5a4831346ed3421dbd5bc9bd0e7a919bfbbf7f22e393202b88363ac70c282e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / complexifier-1.0.0-py3-none-any.whl

Download URL complexifier-1.0.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0239d8323d56a3a4f2d1612ba75b64331906a2322353508fe03ca51091f40ee
BLAKE2b-256 checksum
How to use checksums
31738737e69b352a7326211e5fbd40f003fe3a082610cbabc0628b5e0137d330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page