Random sample/select polygons by attributes iteratively python advice

Discussion created by hcopeland on May 13, 2011
Latest reply on May 20, 2011 by hcopeland
Hi all,

I need to write a script to do the following:

Randomly select polygons (parcels in my case) in a feature class using an attibute with parcel value. It needs to keep selecting parcels randomly until it reaches a total max parcel value. So, if each parcel is valued between 1-100, and I have a max value of 500, it needs to select enough parcels to reach the target value of 500, then I'll do some operations/calculations on these selected parcels. Finally, I need to create a loop to do this 100 or so times.

Is what I propose above doable and fairly straightforward. I'm relatively new at Python programming, so any tips about the logic in the code would be so helpful and appreciated.