⚡ Adds living owanova
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,9 @@
|
|||||||
.idea/
|
.idea/
|
||||||
.zed/
|
.zed/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
venv/
|
venv/
|
||||||
|
__pycache__/
|
||||||
|
|
||||||
*.zip
|
*.zip
|
||||||
*.csv
|
*.csv
|
||||||
|
29
analyze_living.py
Normal file
29
analyze_living.py
Normal 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])
|
@@ -3,7 +3,7 @@ import numpy as np
|
|||||||
from analyze import analyze
|
from analyze import analyze
|
||||||
|
|
||||||
dataset = np.load("clean.npy")
|
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("\t0 - work hours / week >= 10")
|
||||||
print("\t1 - work hours / week < 10")
|
print("\t1 - work hours / week < 10")
|
||||||
print("\t2 - sport")
|
print("\t2 - sport")
|
||||||
|
Reference in New Issue
Block a user