complexifier 0.1.2__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ .venv
2
+ venv
3
+ dist
4
+ *.txt
5
+ *.sh
6
+ __pycache__
7
+ testing.py
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.3
2
+ Name: complexifier
3
+ Version: 0.2.0
4
+ Summary: A library to make data worse
5
+ Project-URL: Homepage, https://github.com/ruyzambrano/complexifier
6
+ Project-URL: Issues, https://github.com/ruyzambrano/complexifier/issues
7
+ Author-email: Ruy Zambrano <ruyzambrano@gmail.com>
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Complexifier
15
+
16
+ This makes your pandas dataframe even worse
17
+
18
+ ## Dependencies
19
+
20
+ - `pandas`
21
+ - `typo`
22
+ - `random`
23
+
24
+ ## Installation
25
+
26
+ `complexifier` can be installed using `pip`
27
+
28
+ ```sh
29
+ pip install complexifier
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ Once installed you can use `complexifier` to add mistakes and outliers to your data
35
+
36
+ This library has several methods available:
37
+
38
+ ### `create_spag_error(word: str) -> str`
39
+
40
+ 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.
41
+
42
+ ### `introduce_spag_error(df: pd.DataFrame, columns=None) -> pd.DataFrame`
43
+
44
+ Applies the create_spag_error function to each string entry in specified columns of a DataFrame, introducing random spelling errors with a 10% probability.
45
+
46
+ **Parameters**:
47
+ - `df`: The DataFrame to be altered.
48
+ - `columns`: Optional; specify column names to apply errors to. If not provided, it defaults to all string columns.
49
+
50
+ ### `add_or_subtract_outliers(df: pd.DataFrame, columns=None) -> pd.DataFrame`
51
+
52
+ Randomly adds or subtracts values in specified numeric columns at random indices, simulating outliers between 1% and 10% of the rows.
53
+
54
+ **Parameters**:
55
+ - `df`: DataFrame to be modified.
56
+ - `columns`: Optional; specify columns to adjust.
57
+
58
+ ### `add_standard_deviations(df: pd.DataFrame, columns=None, min_std=1, max_std=5) -> pd.DataFrame`
59
+
60
+ Adds between 1 to 5 standard deviations to random entries in specified numeric columns to simulate data anomalies.
61
+
62
+ **Parameters**:
63
+ - `df`: The DataFrame to manipulate.
64
+ - `columns`: Optional; specify columns to modify.
65
+ - `min_std`: Minimum number of standard deviations to add.
66
+ - `max_std`: Maximum number of standard deviations to add.
67
+
68
+ ### `duplicate_rows(df: pd.DataFrame, sample_size=None) -> pd.DataFrame`
69
+
70
+ Introduces duplicate rows into a DataFrame. This function is useful for testing deduplication processes.
71
+
72
+ **Parameters**:
73
+ - `df`: DataFrame where duplicates will be introduced.
74
+ - `sample_size`: Optional; number of rows to duplicate. A random percentage between 1% and 10% if not specified.
75
+
76
+ ### `add_nulls(df: pd.DataFrame, columns=None, min_percent=1, max_percent=10) -> pd.DataFrame`
77
+
78
+ Inserts null values into specified DataFrame columns. This simulates missing data conditions.
79
+
80
+ **Parameters**:
81
+ - `df`: The DataFrame to modify.
82
+ - `columns`: Optional; specific columns to add `nulls` to.
83
+ - `min_percent`: Minimum percentage of `null` values to insert.
84
+ - `max_percent`: Maximum percentage of `null` values to insert.
@@ -0,0 +1,71 @@
1
+ # Complexifier
2
+
3
+ This makes your pandas dataframe even worse
4
+
5
+ ## Dependencies
6
+
7
+ - `pandas`
8
+ - `typo`
9
+ - `random`
10
+
11
+ ## Installation
12
+
13
+ `complexifier` can be installed using `pip`
14
+
15
+ ```sh
16
+ pip install complexifier
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Once installed you can use `complexifier` to add mistakes and outliers to your data
22
+
23
+ This library has several methods available:
24
+
25
+ ### `create_spag_error(word: str) -> str`
26
+
27
+ 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.
28
+
29
+ ### `introduce_spag_error(df: pd.DataFrame, columns=None) -> pd.DataFrame`
30
+
31
+ Applies the create_spag_error function to each string entry in specified columns of a DataFrame, introducing random spelling errors with a 10% probability.
32
+
33
+ **Parameters**:
34
+ - `df`: The DataFrame to be altered.
35
+ - `columns`: Optional; specify column names to apply errors to. If not provided, it defaults to all string columns.
36
+
37
+ ### `add_or_subtract_outliers(df: pd.DataFrame, columns=None) -> pd.DataFrame`
38
+
39
+ Randomly adds or subtracts values in specified numeric columns at random indices, simulating outliers between 1% and 10% of the rows.
40
+
41
+ **Parameters**:
42
+ - `df`: DataFrame to be modified.
43
+ - `columns`: Optional; specify columns to adjust.
44
+
45
+ ### `add_standard_deviations(df: pd.DataFrame, columns=None, min_std=1, max_std=5) -> pd.DataFrame`
46
+
47
+ Adds between 1 to 5 standard deviations to random entries in specified numeric columns to simulate data anomalies.
48
+
49
+ **Parameters**:
50
+ - `df`: The DataFrame to manipulate.
51
+ - `columns`: Optional; specify columns to modify.
52
+ - `min_std`: Minimum number of standard deviations to add.
53
+ - `max_std`: Maximum number of standard deviations to add.
54
+
55
+ ### `duplicate_rows(df: pd.DataFrame, sample_size=None) -> pd.DataFrame`
56
+
57
+ Introduces duplicate rows into a DataFrame. This function is useful for testing deduplication processes.
58
+
59
+ **Parameters**:
60
+ - `df`: DataFrame where duplicates will be introduced.
61
+ - `sample_size`: Optional; number of rows to duplicate. A random percentage between 1% and 10% if not specified.
62
+
63
+ ### `add_nulls(df: pd.DataFrame, columns=None, min_percent=1, max_percent=10) -> pd.DataFrame`
64
+
65
+ Inserts null values into specified DataFrame columns. This simulates missing data conditions.
66
+
67
+ **Parameters**:
68
+ - `df`: The DataFrame to modify.
69
+ - `columns`: Optional; specific columns to add `nulls` to.
70
+ - `min_percent`: Minimum percentage of `null` values to insert.
71
+ - `max_percent`: Maximum percentage of `null` values to insert.
@@ -3,7 +3,7 @@ requires = ["hatchling", "pandas", "shutup", "typo"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "complexifier"
6
- version = "0.1.2"
6
+ version = "0.2.0"
7
7
  authors = [
8
8
  { name="Ruy Zambrano", email="ruyzambrano@gmail.com" },
9
9
  ]
@@ -1,5 +0,0 @@
1
- .venv
2
- venv
3
- dist
4
- *.txt
5
- *.sh
@@ -1,43 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: complexifier
3
- Version: 0.1.2
4
- Summary: A library to make data worse
5
- Project-URL: Homepage, https://github.com/ruyzambrano/complexifier
6
- Project-URL: Issues, https://github.com/ruyzambrano/complexifier/issues
7
- Author-email: Ruy Zambrano <ruyzambrano@gmail.com>
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python :: 3
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
-
14
- # Complexifier
15
-
16
- This makes your pandas dataframe even worse
17
-
18
- ## Dependencies
19
-
20
- - `pandas`
21
- - `typo`
22
- - `random`
23
-
24
- ## Installation
25
-
26
- `complexifier` can be installed using `pip`
27
-
28
- ```sh
29
- pip install complexifier
30
- ```
31
-
32
- ## Usage
33
-
34
- Once installed you can use `complexifier` to add mistakes and outliers to your data
35
-
36
- This library has several methods available:
37
-
38
- `introduce_spag_error`: Each item in your pandas has a 10% chance to receive a random spelling error in the data
39
-
40
- `add_or_subtract_outliers`: Adds
41
- - `add_standard_deviations`
42
- - `duplicate_rows`
43
- - `add_nulls`
@@ -1,30 +0,0 @@
1
- # Complexifier
2
-
3
- This makes your pandas dataframe even worse
4
-
5
- ## Dependencies
6
-
7
- - `pandas`
8
- - `typo`
9
- - `random`
10
-
11
- ## Installation
12
-
13
- `complexifier` can be installed using `pip`
14
-
15
- ```sh
16
- pip install complexifier
17
- ```
18
-
19
- ## Usage
20
-
21
- Once installed you can use `complexifier` to add mistakes and outliers to your data
22
-
23
- This library has several methods available:
24
-
25
- `introduce_spag_error`: Each item in your pandas has a 10% chance to receive a random spelling error in the data
26
-
27
- `add_or_subtract_outliers`: Adds
28
- - `add_standard_deviations`
29
- - `duplicate_rows`
30
- - `add_nulls`
@@ -1,16 +0,0 @@
1
- from main import introduce_spag_error
2
- import pandas as pd
3
-
4
- data = pd.DataFrame({
5
- 'Name': ['Alice', 'Bob', 'Charlie', 'David', 'Eva'],
6
- 'Age': [28, 34, 29, 42, 25],
7
- 'City': ['New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix'],
8
- 'Salary': [70000, 80000, 72000, 95000, 67000]
9
- })
10
-
11
- for _ in range(10):
12
- data = pd.concat([data, data])
13
-
14
- data = introduce_spag_error(data, columns="City")
15
-
16
- print(data["City"].value_counts())
File without changes