Adds sleep owanova

This commit is contained in:
Daniel Svitan 2024-12-15 12:20:56 +01:00
parent 7ffbde6c2c
commit cb4241ff97
2 changed files with 28 additions and 3 deletions

View File

@ -66,7 +66,7 @@ The cleaned dataset will have the following structure:
### Sleep ### Sleep
``` ```
0 - long 0 - long sleepers
1 - medium 1 - medium sleepers
2 - short 2 - short sleepers
``` ```

25
analyze_sleep.py Normal file
View File

@ -0,0 +1,25 @@
import numpy as np
from analyze import analyze
dataset = np.load("clean.npy")
print(f"dataset shape: {dataset.shape}, analyzing column 10 (sleep)")
print("\t0 - long sleepers")
print("\t1 - medium sleepers")
print("\t2 - short sleepers")
print("")
def analyze_ses(name: str, col: np.ndarray):
sex_col = dataset[:, 10]
analyze(name, [
col[sex_col == 0],
col[sex_col == 1],
col[sex_col == 2]
])
analyze_ses("gpa", dataset[:, 2])
analyze_ses("math", dataset[:, 3])
analyze_ses("slovak", dataset[:, 4])
analyze_ses("english", dataset[:, 5])