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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsba-python1-alpha
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Auto-checkers for the DSBA Python for Data Science course
5
5
  Project-URL: Homepage, https://github.com/your-org/dsba-checkers
6
6
  License: MIT
@@ -10,5 +10,5 @@ Quick start:
10
10
  q1.solution()
11
11
  """
12
12
 
13
- __version__ = "0.1.0"
13
+ __version__ = "0.1.1"
14
14
  __author__ = "DSBA Python Course"
@@ -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 once at import time ────────────────────────────────────
18
+ # ── Load bundled data ────────────────────────────────────────────────────────
19
19
 
20
- def _load_df():
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 = _load_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"]
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "dsba-python1-alpha"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Auto-checkers for the DSBA Python for Data Science course"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"