do - loop

H

Hita Vora

I have a dataset which has about 3000 subjects in it. I take each subject and perform 3 to 4 geoprocessing tasks on it. Currently I have a model where I manually feed in each subject's ID and then the rest of the process is automated. I would like to automate the process such that it would automatically select another subject after the process has been completed on a specfic subject. ie to repeat the same process on each of the IDs.

Any help such as a dummy code would be greatly appreciated.

Thanks.

Hita
 
B

Ben Finney

Hita Vora said:
I have a dataset which has about 3000 subjects in it. I take each
subject and perform 3 to 4 geoprocessing tasks on it. Currently I
have a model where I manually feed in each subject's ID and then the
rest of the process is automated. I would like to automate the
process such that it would automatically select another subject
after the process has been completed on a specfic subject. ie to
repeat the same process on each of the IDs.

def do_the_stuff(subject):
""" Do the stuff to a single subject """
pass

for this_subject in all_subjects:
do_the_stuff(this_subject)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top