When only one patient in the subject_ids text file, np.loadtext function will squeeze the mono-dimensional axes, leading to an error when looping over subject_ids: "iteration over a 0-d array"
We need to specify the minimum dimension of outputs to avoid this problem
Suggested correction :
subject_ids=np.loadtxt(subject_dir+subject_ids_filename, dtype='str', ndmin = 1)
|
subject_ids=np.loadtxt(subject_dir+subject_ids_filename, dtype='str') |