<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script for selecting values that are multiples in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202082#M15559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Related, you can use the built in "divmod" function in Python to evalute/test for multiples. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; divmod(120, 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(12, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; divmod(121, 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(12, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for i in range (0,1001):
&amp;nbsp;&amp;nbsp; if divmod(i, 10)[1] == 0: #if the remainder is 0 when dividing by 10...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Processing #" + str(i)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:02:25 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-11T10:02:25Z</dc:date>
    <item>
      <title>Script for selecting values that are multiples</title>
      <link>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202080#M15557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am wondering if there is a script available that will select attribute values that are multiples of 10.&amp;nbsp; I have a large dataset of USNG 100 meter polygons that I would like to simplify.&amp;nbsp; I have attribute columns for easting and northing values that are short integers.&amp;nbsp; My goal is to select every tenth easting row and northing column beginning at a certain value.&amp;nbsp; For example, I'm beginning with an easting value of 590 and I'd like to then select the 600 easting column, 610, 620 and so on.&amp;nbsp; Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 13:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202080#M15557</guid>
      <dc:creator>TomKoritansky</dc:creator>
      <dc:date>2012-01-19T13:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script for selecting values that are multiples</title>
      <link>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202081#M15558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could do this using the SelectLayerByAttributes function.&amp;nbsp; Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"

fc = "USNG_100Meter"
arcpy.MakeFeatureLayer_management(fc, "USNG_lyr")

x = 590
y = 1000

while x &amp;lt;= 740: # alter to the max value of the Easting
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("USNG_lyr", "NEW_SELECTION", '"Easting" = ' + str(x) + "AND" + '"Northing" = ' + str(y))
&amp;nbsp;&amp;nbsp;&amp;nbsp; # do something to selection
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 10
&amp;nbsp;&amp;nbsp;&amp;nbsp; y += 10&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202081#M15558</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T10:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script for selecting values that are multiples</title>
      <link>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202082#M15559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Related, you can use the built in "divmod" function in Python to evalute/test for multiples. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; divmod(120, 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(12, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; divmod(121, 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(12, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for i in range (0,1001):
&amp;nbsp;&amp;nbsp; if divmod(i, 10)[1] == 0: #if the remainder is 0 when dividing by 10...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Processing #" + str(i)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:02:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-selecting-values-that-are-multiples/m-p/202082#M15559</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T10:02:25Z</dc:date>
    </item>
  </channel>
</rss>

