⚡ Adds sleep owanova
This commit is contained in:
parent
7ffbde6c2c
commit
cb4241ff97
6
CLEAN.md
6
CLEAN.md
@ -66,7 +66,7 @@ The cleaned dataset will have the following structure:
|
||||
### Sleep
|
||||
|
||||
```
|
||||
0 - long
|
||||
1 - medium
|
||||
2 - short
|
||||
0 - long sleepers
|
||||
1 - medium sleepers
|
||||
2 - short sleepers
|
||||
```
|
||||
|
25
analyze_sleep.py
Normal file
25
analyze_sleep.py
Normal 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])
|
Loading…
x
Reference in New Issue
Block a user