eda-tools-oyu 0.1.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,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: eda-tools-oyu
3
+ Version: 0.1.0
4
+ Description-Content-Type: text/markdown
5
+ Requires-Dist: pandas
6
+ Requires-Dist: numpy
7
+ Requires-Dist: matplotlib
8
+ Requires-Dist: seaborn
@@ -0,0 +1,10 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "eda-tools-oyu"
7
+ version = "0.1.0"
8
+ readme = "README.md"
9
+ dependencies = ["pandas", "numpy",
10
+ "matplotlib", "seaborn"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,59 @@
1
+ import numpy as np # type: ignore
2
+ import pandas as pd # type: ignore
3
+ import matplotlib.pyplot as plt # type: ignore
4
+ import seaborn as sns # type: ignore
5
+
6
+
7
+ def basic_stats(x):
8
+ """Тоон массивын үндсэн статистик."""
9
+ x = np.array(x)
10
+ return {"n": len(x),
11
+ "mean": round(float(x.mean()), 2),
12
+ "median": float(np.median(x)),
13
+ "std": round(float(x.std(ddof=1)), 2),
14
+ "min": float(x.min()),
15
+ "max": float(x.max())}
16
+
17
+
18
+ def iqr_outliers(x):
19
+ """1.5 x IQR дүрмээр outlier утгуудыг буцаана."""
20
+ x = np.array(x)
21
+ q1, q3 = np.percentile(x, [25, 75])
22
+ iqr = q3 - q1
23
+ return x[(x < q1 - 1.5 * iqr) | (x > q3 + 1.5 * iqr)]
24
+
25
+
26
+ def missing_report(df):
27
+ """Багана бүрийн хоосон утгын тоо ба хувь."""
28
+ n = df.isnull().sum()
29
+ return pd.DataFrame({"missing": n, "percent": (n / len(df) * 100).round(1)})
30
+
31
+
32
+ def group_rate(df, by, target):
33
+ """Бүлэг бүрийн хүний тоо ба target-ийн дундаж."""
34
+ return df.groupby(by)[target].agg(["count", "mean"]).round(2)
35
+
36
+
37
+ def plot_hist(df, col):
38
+ """Histogram, дундаж ба медианы шугамтай."""
39
+ fig, ax = plt.subplots(figsize=(7, 4))
40
+ ax.hist(df[col], bins=30, edgecolor="white")
41
+ ax.axvline(df[col].mean(), color="orange", lw=4, label=f"дундаж = {df[col].mean():.1f}")
42
+ ax.axvline(df[col].median(), color="red", lw=2, ls="--", label=f"медиан = {df[col].median():.1f}")
43
+ ax.set_title(col); ax.legend()
44
+ plt.show()
45
+
46
+
47
+ def plot_box(df, x, y):
48
+ """Бүлэг бүрийн тархалтыг boxplot-оор харьцуулна."""
49
+ sns.boxplot(data=df, x=x, y=y)
50
+ plt.title(f"{y} ба {x}")
51
+ plt.show()
52
+
53
+
54
+ def plot_corr(df):
55
+ """Тоон багануудын корреляцийн heatmap."""
56
+ corr = df.select_dtypes("number").corr()
57
+ sns.heatmap(corr, annot=True, fmt=".2f", cmap="coolwarm", vmin=-1, vmax=1)
58
+ plt.title("Корреляц")
59
+ plt.show()
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: eda-tools-oyu
3
+ Version: 0.1.0
4
+ Description-Content-Type: text/markdown
5
+ Requires-Dist: pandas
6
+ Requires-Dist: numpy
7
+ Requires-Dist: matplotlib
8
+ Requires-Dist: seaborn
@@ -0,0 +1,7 @@
1
+ pyproject.toml
2
+ src/core.py
3
+ src/eda_tools_oyu.egg-info/PKG-INFO
4
+ src/eda_tools_oyu.egg-info/SOURCES.txt
5
+ src/eda_tools_oyu.egg-info/dependency_links.txt
6
+ src/eda_tools_oyu.egg-info/requires.txt
7
+ src/eda_tools_oyu.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ pandas
2
+ numpy
3
+ matplotlib
4
+ seaborn