How can I alter this for loop to turn it into a list? Thanks in advance.
for x in column_list:
des, res=rp.ttest(group1= df[x][df['patients'] == 1], group1_name= "Patients",
group2= df[x][df['patients'] == 0], group2_name= "Controls")
res1=res.set_index('Independent t-test').T
y=res1['Two side test p value = '].values
if y < 0.005:
print (x,y)