dsba-python1-alpha 0.1.0__tar.gz → 0.1.1__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.
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/PKG-INFO +1 -1
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/__init__.py +1 -1
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/workshops/w14_scipy.py +14 -7
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/pyproject.toml +1 -1
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/README.md +0 -0
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/base_task.py +0 -0
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/data/__init__.py +0 -0
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/data/insurance.csv +0 -0
- {dsba_python1_alpha-0.1.0 → dsba_python1_alpha-0.1.1}/dsba_checkers/workshops/__init__.py +0 -0
|
@@ -5,7 +5,7 @@ Checker for Workshop 14 — Using scipy.stats
|
|
|
5
5
|
Dataset bundled inside the package (insurance.csv).
|
|
6
6
|
|
|
7
7
|
Usage:
|
|
8
|
-
from dsba_checkers.workshops.w14_scipy import q1, q2, q3, q4, q5, q6, q7
|
|
8
|
+
from dsba_checkers.workshops.w14_scipy import q1, q2, q3, q4, q5, q6, q7, load_df
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
import importlib.resources
|
|
@@ -15,20 +15,27 @@ from scipy import stats
|
|
|
15
15
|
|
|
16
16
|
from ..base_task import Task
|
|
17
17
|
|
|
18
|
-
# ── Load bundled data
|
|
18
|
+
# ── Load bundled data ────────────────────────────────────────────────────────
|
|
19
19
|
|
|
20
|
-
def
|
|
20
|
+
def load_df() -> pd.DataFrame:
|
|
21
|
+
"""Return the insurance dataset as a pandas DataFrame.
|
|
22
|
+
|
|
23
|
+
The CSV is bundled inside the package — no internet required.
|
|
24
|
+
|
|
25
|
+
Example
|
|
26
|
+
-------
|
|
27
|
+
from dsba_checkers.workshops.w14_scipy import load_df
|
|
28
|
+
df = load_df()
|
|
29
|
+
"""
|
|
21
30
|
try:
|
|
22
|
-
# Python 3.9+
|
|
23
31
|
ref = importlib.resources.files("dsba_checkers.data").joinpath("insurance.csv")
|
|
24
32
|
with importlib.resources.as_file(ref) as path:
|
|
25
33
|
return pd.read_csv(path)
|
|
26
34
|
except AttributeError:
|
|
27
|
-
# Python 3.8 fallback
|
|
28
35
|
with importlib.resources.open_text("dsba_checkers.data", "insurance.csv") as f:
|
|
29
36
|
return pd.read_csv(f)
|
|
30
37
|
|
|
31
|
-
_df =
|
|
38
|
+
_df = load_df()
|
|
32
39
|
|
|
33
40
|
|
|
34
41
|
# ── Task 1 — Descriptive statistics for `charges` ───────────────────────────
|
|
@@ -283,4 +290,4 @@ q5 = _Q5_TTest()
|
|
|
283
290
|
q6 = _Q6_PairedTTest()
|
|
284
291
|
q7 = _Q7_Bonferroni()
|
|
285
292
|
|
|
286
|
-
__all__ = ["q1", "q2", "q3", "q4", "q5", "q6", "q7"]
|
|
293
|
+
__all__ = ["q1", "q2", "q3", "q4", "q5", "q6", "q7", "load_df"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|