I want to open many files to do an analysis through python. The title changes in three ways, ID, intervention and drug_type
So I define the path where the files are and create three list variables which contain the names I want to swap parts of the string with.
path = r'R:\Storage\healthsciences\SPRH\pwelch'
ID = ['P1','P2','P3','P4','P5']
intervention = ['intervention1','intervention2']
drug_type = ['drug1','drug2','drug3','drug4']
filename = P1_intervention1_drug2_pwelch_output
How would I get the different sections to change in a for loop?
So..
filename =
[ID]'_'[intervention]'_'drug_type'_pwelch_output.mat'
with each list variable changing as it loops over
Any push in the right direction is much appreciated :)