diff --git a/.gitignore b/.gitignore index 91fd383..ef49f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .idea/ .zed/ .vscode/ + venv/ +__pycache__/ *.zip *.csv diff --git a/analyze_living.py b/analyze_living.py new file mode 100644 index 0000000..1f11a8a --- /dev/null +++ b/analyze_living.py @@ -0,0 +1,29 @@ +import numpy as np + +from analyze import analyze + +dataset = np.load("clean.npy") +print(f"dataset shape: {dataset.shape}, analyzing column 7 (living)") +print("\t0 - with family") +print("\t1 - with family member") +print("\t2 - alone / roomates") +print("\t3 - dorms") +print("\t4 - other") +print("") + + +def analyze_living(name: str, col: np.ndarray): + occupation_col = dataset[:, 7] + analyze(name, [ + col[occupation_col == 0], + col[occupation_col == 1], + col[occupation_col == 2], + col[occupation_col == 3], + col[occupation_col == 4] + ]) + + +analyze_living("gpa", dataset[:, 2]) +analyze_living("math", dataset[:, 3]) +analyze_living("slovak", dataset[:, 4]) +analyze_living("english", dataset[:, 5]) diff --git a/analyze_occupation.py b/analyze_occupation.py index f322934..b4b842b 100644 --- a/analyze_occupation.py +++ b/analyze_occupation.py @@ -3,7 +3,7 @@ import numpy as np from analyze import analyze dataset = np.load("clean.npy") -print(f"dataset shape: {dataset.shape}, analyzing column 6 (sex)") +print(f"dataset shape: {dataset.shape}, analyzing column 6 (occupation)") print("\t0 - work hours / week >= 10") print("\t1 - work hours / week < 10") print("\t2 - sport")