Adds living owanova

This commit is contained in:
Daniel Svitan
2024-12-15 12:07:17 +01:00
parent cff5dcefe4
commit 25ae210f1c
3 changed files with 32 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1,7 +1,9 @@
.idea/
.zed/
.vscode/
venv/
__pycache__/
*.zip
*.csv

29
analyze_living.py Normal file
View File

@@ -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])

View File

@@ -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")