Skip to content

Commit a377d81

Browse files
StevanusOCopilot
andcommitted
Config Viz Py forgot to add ext file, add categorical_viz file, add environment (pyproject.toml, uv.lock, and requirements.txt)
Co-authored-by: Copilot <copilot@github.com>
1 parent 9d917fc commit a377d81

6 files changed

Lines changed: 2279 additions & 11 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Python bytecode
66
__pycache__/
77
*.pyc
8-
pyproject.toml
9-
uv.lock
108

119
# Github Agent Skills
1210
.agents/

categorical_viz.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import pandas as pd
2+
import numpy as np
3+
import matplotlib.pyplot as plt
4+
import seaborn as sns
5+
6+
from typing import Optional, List
7+
8+
def plot_categorical_distribution(df: pd.DataFrame(), columns: Optional[List[str]] = None, target_col: Optional[str] = None, n_cols:int =3) -> None:
9+
10+
if columns is None:
11+
print("[!] Columns is empty, automatically select categorical based on df")
12+
columns = df.select_dtypes(include=["object", "category"]).columns.tolist()
13+
if not columns:
14+
print("[!] No categorical columns found in the DataFrame.")
15+
return
16+
17+
if target_col and target_col not in df.columns:
18+
print(f"[!] Target column '{target_col}' not found in the DataFrame. Ignoring target_col.")
19+
target_col = None
20+
21+
n_rows = int(np.ceil(len(columns) / n_cols))
22+
23+
# Create figure
24+
fig, axes = plt.subplots(n_rows, n_cols, figsize=(15, 5 * n_rows))
25+
26+
# Flatten axes for easy iteration
27+
axes = axes.flatten()
28+
for i, col in enumerate(columns):
29+
ax = axes[i]
30+
31+
sns.countplot(data=df, x=col, ax=ax, hue=target_col)
32+
ax.grid(color='r', linestyle='-', linewidth=2)
33+
ax.set_axisbelow(True)
34+
ax.set_title(col)
35+
ax.tick_params(axis='x', rotation=25)
36+
37+
# Remove unused subplots
38+
for j in range(i + 1, len(axes)):
39+
fig.delaxes(axes[j])
40+
plt.tight_layout()
41+
plt.show()
File renamed without changes.

pyproject.toml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
[project]
2+
name = "utils"
3+
version = "0.1.0"
4+
requires-python = ">=3.14"
5+
dependencies = [
6+
"anyio==4.13.0",
7+
"argon2-cffi==25.1.0",
8+
"argon2-cffi-bindings==25.1.0",
9+
"arrow==1.4.0",
10+
"asttokens==3.0.1",
11+
"async-lru==2.3.0",
12+
"attrs==26.1.0",
13+
"babel==2.18.0",
14+
"beautifulsoup4==4.14.3",
15+
"bleach==6.3.0",
16+
"certifi==2026.4.22",
17+
"cffi==2.0.0",
18+
"charset-normalizer==3.4.7",
19+
"comm==0.2.3",
20+
"contourpy==1.3.3",
21+
"cycler==0.12.1",
22+
"debugpy==1.8.20",
23+
"decorator==5.2.1",
24+
"defusedxml==0.7.1",
25+
"executing==2.2.1",
26+
"fastjsonschema==2.21.2",
27+
"fonttools==4.62.1",
28+
"fqdn==1.5.1",
29+
"h11==0.16.0",
30+
"httpcore==1.0.9",
31+
"httpx==0.28.1",
32+
"idna==3.13",
33+
"ipykernel==7.2.0",
34+
"ipython==9.13.0",
35+
"ipython-pygments-lexers==1.1.1",
36+
"ipywidgets==8.1.8",
37+
"isoduration==20.11.0",
38+
"jedi==0.19.2",
39+
"jinja2==3.1.6",
40+
"joblib==1.5.3",
41+
"json5==0.14.0",
42+
"jsonpointer==3.1.1",
43+
"jsonschema==4.26.0",
44+
"jsonschema-specifications==2025.9.1",
45+
"jupyter==1.1.1",
46+
"jupyter-client==8.8.0",
47+
"jupyter-console==6.6.3",
48+
"jupyter-core==5.9.1",
49+
"jupyter-events==0.12.1",
50+
"jupyter-lsp==2.3.1",
51+
"jupyter-server==2.17.0",
52+
"jupyter-server-terminals==0.5.4",
53+
"jupyterlab==4.5.6",
54+
"jupyterlab-pygments==0.3.0",
55+
"jupyterlab-server==2.28.0",
56+
"jupyterlab-widgets==3.0.16",
57+
"kiwisolver==1.5.0",
58+
"lark==1.3.1",
59+
"lxml==6.1.0",
60+
"markupsafe==3.0.3",
61+
"matplotlib==3.10.9",
62+
"matplotlib-inline==0.2.1",
63+
"mistune==3.2.0",
64+
"narwhals==2.20.0",
65+
"nbclient==0.10.4",
66+
"nbconvert==7.17.1",
67+
"nbformat==5.10.4",
68+
"nest-asyncio==1.6.0",
69+
"notebook==7.5.5",
70+
"notebook-shim==0.2.4",
71+
"numpy==2.4.4",
72+
"packaging==26.1",
73+
"pandas==3.0.2",
74+
"pandocfilters==1.5.1",
75+
"parso==0.8.6",
76+
"pexpect==4.9.0",
77+
"pillow==12.2.0",
78+
"platformdirs==4.9.6",
79+
"plotly==6.7.0",
80+
"prometheus-client==0.25.0",
81+
"prompt-toolkit==3.0.52",
82+
"psutil==7.2.2",
83+
"ptyprocess==0.7.0",
84+
"pure-eval==0.2.3",
85+
"pycparser==3.0",
86+
"pygments==2.20.0",
87+
"pyparsing==3.3.2",
88+
"python-dateutil==2.9.0.post0",
89+
"python-json-logger==4.1.0",
90+
"pyyaml==6.0.3",
91+
"pyzmq==27.1.0",
92+
"referencing==0.37.0",
93+
"requests==2.33.1",
94+
"rfc3339-validator==0.1.4",
95+
"rfc3986-validator==0.1.1",
96+
"rfc3987-syntax==1.1.0",
97+
"rpds-py==0.30.0",
98+
"scikit-learn==1.8.0",
99+
"scipy==1.17.1",
100+
"seaborn==0.13.2",
101+
"send2trash==2.1.0",
102+
"setuptools==82.0.1",
103+
"six==1.17.0",
104+
"soupsieve==2.8.3",
105+
"stack-data==0.6.3",
106+
"terminado==0.18.1",
107+
"threadpoolctl==3.6.0",
108+
"tinycss2==1.4.0",
109+
"tornado==6.5.5",
110+
"traitlets==5.14.3",
111+
"typing-extensions==4.15.0",
112+
"tzdata==2026.2",
113+
"uri-template==1.3.0",
114+
"urllib3==2.6.3",
115+
"wcwidth==0.6.0",
116+
"webcolors==25.10.0",
117+
"webencodings==0.5.1",
118+
"websocket-client==1.9.0",
119+
"widgetsnbextension==4.0.15",
120+
]

requirements.txt

Lines changed: 114 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,114 @@
1-
numpy
2-
pandas
3-
lxml
4-
ipykernel
5-
jupyter
6-
matplotlib
7-
seaborn
8-
scikit-learn
9-
plotly
1+
anyio==4.13.0
2+
argon2-cffi==25.1.0
3+
argon2-cffi-bindings==25.1.0
4+
arrow==1.4.0
5+
asttokens==3.0.1
6+
async-lru==2.3.0
7+
attrs==26.1.0
8+
babel==2.18.0
9+
beautifulsoup4==4.14.3
10+
bleach==6.3.0
11+
certifi==2026.4.22
12+
cffi==2.0.0
13+
charset-normalizer==3.4.7
14+
comm==0.2.3
15+
contourpy==1.3.3
16+
cycler==0.12.1
17+
debugpy==1.8.20
18+
decorator==5.2.1
19+
defusedxml==0.7.1
20+
executing==2.2.1
21+
fastjsonschema==2.21.2
22+
fonttools==4.62.1
23+
fqdn==1.5.1
24+
h11==0.16.0
25+
httpcore==1.0.9
26+
httpx==0.28.1
27+
idna==3.13
28+
ipykernel==7.2.0
29+
ipython==9.13.0
30+
ipython-pygments-lexers==1.1.1
31+
ipywidgets==8.1.8
32+
isoduration==20.11.0
33+
jedi==0.19.2
34+
jinja2==3.1.6
35+
joblib==1.5.3
36+
json5==0.14.0
37+
jsonpointer==3.1.1
38+
jsonschema==4.26.0
39+
jsonschema-specifications==2025.9.1
40+
jupyter==1.1.1
41+
jupyter-client==8.8.0
42+
jupyter-console==6.6.3
43+
jupyter-core==5.9.1
44+
jupyter-events==0.12.1
45+
jupyter-lsp==2.3.1
46+
jupyter-server==2.17.0
47+
jupyter-server-terminals==0.5.4
48+
jupyterlab==4.5.6
49+
jupyterlab-pygments==0.3.0
50+
jupyterlab-server==2.28.0
51+
jupyterlab-widgets==3.0.16
52+
kiwisolver==1.5.0
53+
lark==1.3.1
54+
lxml==6.1.0
55+
markupsafe==3.0.3
56+
matplotlib==3.10.9
57+
matplotlib-inline==0.2.1
58+
mistune==3.2.0
59+
narwhals==2.20.0
60+
nbclient==0.10.4
61+
nbconvert==7.17.1
62+
nbformat==5.10.4
63+
nest-asyncio==1.6.0
64+
notebook==7.5.5
65+
notebook-shim==0.2.4
66+
numpy==2.4.4
67+
packaging==26.1
68+
pandas==3.0.2
69+
pandocfilters==1.5.1
70+
parso==0.8.6
71+
pexpect==4.9.0
72+
pillow==12.2.0
73+
platformdirs==4.9.6
74+
plotly==6.7.0
75+
prometheus-client==0.25.0
76+
prompt-toolkit==3.0.52
77+
psutil==7.2.2
78+
ptyprocess==0.7.0
79+
pure-eval==0.2.3
80+
pycparser==3.0
81+
pygments==2.20.0
82+
pyparsing==3.3.2
83+
python-dateutil==2.9.0.post0
84+
python-json-logger==4.1.0
85+
pyyaml==6.0.3
86+
pyzmq==27.1.0
87+
referencing==0.37.0
88+
requests==2.33.1
89+
rfc3339-validator==0.1.4
90+
rfc3986-validator==0.1.1
91+
rfc3987-syntax==1.1.0
92+
rpds-py==0.30.0
93+
scikit-learn==1.8.0
94+
scipy==1.17.1
95+
seaborn==0.13.2
96+
send2trash==2.1.0
97+
setuptools==82.0.1
98+
six==1.17.0
99+
soupsieve==2.8.3
100+
stack-data==0.6.3
101+
terminado==0.18.1
102+
threadpoolctl==3.6.0
103+
tinycss2==1.4.0
104+
tornado==6.5.5
105+
traitlets==5.14.3
106+
typing-extensions==4.15.0
107+
tzdata==2026.2
108+
uri-template==1.3.0
109+
urllib3==2.6.3
110+
wcwidth==0.6.0
111+
webcolors==25.10.0
112+
webencodings==0.5.1
113+
websocket-client==1.9.0
114+
widgetsnbextension==4.0.15

0 commit comments

Comments
 (0)