Skip to content

Commit

Permalink
Opens the files into numpy arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
samblouir committed Feb 13, 2021
1 parent 46ece7f commit 3b763d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Python/tf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@
adhd_part1_paths = [ADHD_part1_path+path for path in os.listdir(ADHD_part1_path)]
adhd_part2_paths = [ADHD_part2_path+path for path in os.listdir(ADHD_part2_path)]

# Opens the files into numpy arrays
adhd_part1_data = [load_mat(path) for path in adhd_part1_paths]
adhd_part2_data = [load_mat(path) for path in adhd_part2_paths]
adhd_part2_data = [load_mat(path) for path in adhd_part2_paths]

print('\n\n\n')
for line in adhd_part1_data:
print(line)
exit(0)
4 changes: 3 additions & 1 deletion Python/tf/shared_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import numpy as np
import scipy.io
import h5py

def load_mat(in_path: str) -> dict:
def load_mat(in_path: str) -> np.ndarray:
return_mat = scipy.io.loadmat(in_path)
return_mat = np.array(return_mat)
return return_mat

0 comments on commit 3b763d5

Please sign in to comment.