hotiq 1.0.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.
- hotiq-1.0.0/PKG-INFO +6 -0
- hotiq-1.0.0/hotiq.egg-info/PKG-INFO +6 -0
- hotiq-1.0.0/hotiq.egg-info/SOURCES.txt +7 -0
- hotiq-1.0.0/hotiq.egg-info/dependency_links.txt +1 -0
- hotiq-1.0.0/hotiq.egg-info/top_level.txt +2 -0
- hotiq-1.0.0/preprocessor_helper/__init__.py +1 -0
- hotiq-1.0.0/preprocessor_helper/codes.py +109 -0
- hotiq-1.0.0/pyproject.toml +16 -0
- hotiq-1.0.0/setup.cfg +4 -0
hotiq-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .codes import *
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
def basic_code():
|
|
2
|
+
print('''
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import numpy as np
|
|
5
|
+
|
|
6
|
+
df = pd.read_csv("train.csv")
|
|
7
|
+
|
|
8
|
+
print(df.head())
|
|
9
|
+
print(df.shape)
|
|
10
|
+
df.info()
|
|
11
|
+
print(df.describe())
|
|
12
|
+
''')
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def missing_code():
|
|
16
|
+
print('''
|
|
17
|
+
print(df.isnull().sum())
|
|
18
|
+
|
|
19
|
+
df["Age"] = df["Age"].fillna(df["Age"].median())
|
|
20
|
+
|
|
21
|
+
df["Embarked"] = df["Embarked"].fillna(
|
|
22
|
+
df["Embarked"].mode()[0]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
df.drop("Cabin", axis=1, inplace=True)
|
|
26
|
+
''')
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def duplicate_code():
|
|
30
|
+
print('''
|
|
31
|
+
print(df.duplicated().sum())
|
|
32
|
+
|
|
33
|
+
df.drop_duplicates(inplace=True)
|
|
34
|
+
''')
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def add_column_code():
|
|
38
|
+
print('''
|
|
39
|
+
# Add a new column with a constant value
|
|
40
|
+
df["New_Column"] = 0
|
|
41
|
+
|
|
42
|
+
# Titanic example: Family Size
|
|
43
|
+
df["FamilySize"] = df["SibSp"] + df["Parch"] + 1
|
|
44
|
+
|
|
45
|
+
# Titanic example: Age Group
|
|
46
|
+
df["AgeGroup"] = pd.cut(
|
|
47
|
+
df["Age"],
|
|
48
|
+
bins=[0, 18, 40, 60, 100],
|
|
49
|
+
labels=["Child", "Adult", "Middle Age", "Senior"]
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
print(df.head())
|
|
53
|
+
''')
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def drop_column_code():
|
|
57
|
+
print('''
|
|
58
|
+
df.drop(
|
|
59
|
+
["PassengerId", "Name", "Ticket"],
|
|
60
|
+
axis=1,
|
|
61
|
+
inplace=True
|
|
62
|
+
)
|
|
63
|
+
''')
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def encoding_code():
|
|
67
|
+
print('''
|
|
68
|
+
from sklearn.preprocessing import LabelEncoder
|
|
69
|
+
|
|
70
|
+
le = LabelEncoder()
|
|
71
|
+
|
|
72
|
+
df["Sex"] = le.fit_transform(df["Sex"])
|
|
73
|
+
df["Embarked"] = le.fit_transform(df["Embarked"])
|
|
74
|
+
''')
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def scaling_code():
|
|
78
|
+
print('''
|
|
79
|
+
from sklearn.preprocessing import MinMaxScaler
|
|
80
|
+
|
|
81
|
+
scaler = MinMaxScaler()
|
|
82
|
+
|
|
83
|
+
df[["Age", "Fare"]] = scaler.fit_transform(
|
|
84
|
+
df[["Age", "Fare"]]
|
|
85
|
+
)
|
|
86
|
+
''')
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def show_code():
|
|
90
|
+
print("========== BASIC DATA CHECKING ==========")
|
|
91
|
+
basic_code()
|
|
92
|
+
|
|
93
|
+
print("========== MISSING VALUES ==========")
|
|
94
|
+
missing_code()
|
|
95
|
+
|
|
96
|
+
print("========== DUPLICATE VALUES ==========")
|
|
97
|
+
duplicate_code()
|
|
98
|
+
|
|
99
|
+
print("========== ADDING COLUMNS ==========")
|
|
100
|
+
add_column_code()
|
|
101
|
+
|
|
102
|
+
print("========== DROPPING COLUMNS ==========")
|
|
103
|
+
drop_column_code()
|
|
104
|
+
|
|
105
|
+
print("========== ENCODING ==========")
|
|
106
|
+
encoding_code()
|
|
107
|
+
|
|
108
|
+
print("========== SCALING ==========")
|
|
109
|
+
scaling_code()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "hotiq"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Simple data preprocessing code helper for Python"
|
|
9
|
+
requires-python = ">=3.9"
|
|
10
|
+
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Abhinav B Prasad"}
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[tool.setuptools.packages.find]
|
|
16
|
+
where = ["."]
|
hotiq-1.0.0/setup.cfg
ADDED