AnsweredAssumed Answered

Using values in row as a filter/parameter in a Script.

Question asked by akeener3 on Dec 5, 2017
Latest reply on Dec 5, 2017 by Dan_Patterson

Is there a way for me to use a value in a row as a filter/parameter in a script?

 

This hypothetical example would be of a massive csv file with a list of gps locations of wild animals, and one of the columns was "Type of Animal". The problem is, the values are repeated - bear, bird, lion, etc. dozens to hundreds of times, once for each gps x,y. Is there a way I can get the unique values form this column, and use them as a selection parameter in script and eventually a tool?

 

Example Parameters could be:

CSV File

Output Feature Class

Select Animal (optional)

      Lion

      Bear

      etc.

 

With the Select Animal as Optional, if none are selected it plots all locations. In this, one would just plot lions, or bears. 

 

Is this a thing? If so, how do I do this with acrpy (not model builder)? Is there example code somewhere?

 

I have Desktop 10.5, python 2.7.

Outcomes