I have a large set of data, say A. I have a for loop. In every iteration, I'm going to only work with the subset of data of A, say A_sub, which are the elments of A that satisfy some conditions, such as within some ranges. Then, I'm also going to work with the subset of the A_sub, say A_sub_sub, which are the elements of A_sub that satisfy certain conditions, such as within some ranges. I don't know how many elements that's going to satisfy the certain condition, so I don't know the size of A_sub and A_sub_sub in advance. So the size of A_sub and A_sub_sub is going to change at each iteration. Is there a better way to do it?