Skip to content

Error to loop over subject_ids when only one patient in the subject_ids text file #3

@mathrip

Description

@mathrip

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')

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions