I would like to know how to randomly select certain values from the attribute table.
A good discussion along with several good code examples can be found in previous threads, including Help altering some python code to randomly select one feature .
You can use the random module. Do you need random values in an attribute table? Or random rows?
I need to use it from python and not from ArcMap. Also, I just need to select the attributes and not assign random numbers to it.
The random module is a Python module.... Do you need to select random attributes from a single field? All fields? Some fields?
Please expand on your question. Give an example.
Ahhh, then generate your random integers, and use those in a search cursor to extract the values you need
Add a field to your table
Do a field calculation as described here
or you can substitute random.randint in place of random.random if you want integers.
a = random.randint(1, 100)a96
or even draw from a uniform distribution
u = int(random.uniform(0, 100))u54
or other types of distributions depending on your needs
Thank you so much. This seems to work for me.
Retrieving data ...