Trying to find the way to perform a set of processing steps to list of arrays through a loop
Assume we have only one array. We perform the following iterative steps , so we can then run diagnostics for each step if needed. The process of each step is irrelevant, but the output is saved in a new array as an intermediate (step1, step2, step3...etc).
a=(rand(10000,4))
#This is the process that i want to repeat for all the arrays:
a_step1=a[a[:,0]<0.1] #This is the first step
a_step2=a_step1[a_step1[:,1]>0.1] #second
a_step3=a_step2[a_step2[:,2]<0.5] #third
.... #etc
Like this in the end i have a, a_step1, a_step2, a_step3
as arrays that i can perform checks on.
So i would like to do this over a series of arrays (a,b,c,d...)
i have tried this
a=(rand(10000,4))
b=(rand(10000,4))
c=(rand(10000,4))
d=(rand(10000,4))
for i in (a,b,c,d):
(i)_step1=(i)[(i)[:,0]<0.1]
(i)_step2=(i)_step1[(i)_step1[:,1]>0.1]
(i)_step3=(i)_step2[(i)_step2[:,2]<0.5]
.....
and got:
File "<ipython-input-732-7917e62bc9c0>", line 6
(i)_step1=(i)[(i)[:,0]<0.1]
^
SyntaxError: invalid syntax
So given the list of all arrays (a,b,c,d...) i would like in the end to have the following produced as arrays to run checks on:
a_step1, b_step1, c_step1, d_step1
a_step2, b_step2, c_step2, d_step2
a_step3, b_step3, c_step3, d_step3
.......
It seems so simple but i can't wrap my head around it.....