<?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: Modifying unique value definition to account for multiple factors? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/modifying-unique-value-definition-to-account-for/m-p/1236118#M66178</link>
    <description>&lt;P&gt;Where is inValue coming from? if its a cursor, then add the GPS_Y_N field and pass that in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def isDuplicate(inValue, gps):
    if all([inValue in uniqueList, gps == 'N']):
        return 1
    else:
        uniqueList.append(inValue)
        return 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If not, use a search cursor and get the value.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2022 19:47:31 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-11-29T19:47:31Z</dc:date>
    <item>
      <title>Modifying unique value definition to account for multiple factors?</title>
      <link>https://community.esri.com/t5/python-questions/modifying-unique-value-definition-to-account-for/m-p/1236108#M66177</link>
      <description>&lt;P&gt;I have inherited a list of assets that contains duplicate features. For reference, the asset number (PTR__) is the duplicate field. I am attempting to label duplicates by using a new 'long' filed and calculating the field using the following script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;uniqueList = []&lt;BR /&gt;def isDuplicate(inValue):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if inValue in uniqueList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;uniqueList.append(inValue)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would like to modify this code to also account for whether the point has been GPS's (field:GPS_Y_N). What I am hoping to see is this: if GPS_Y_N = N AND PTR__ is duplicate - return 1, else return 0. However, I am not sure how to modify this to accommodate the additional parameter.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 19:25:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modifying-unique-value-definition-to-account-for/m-p/1236108#M66177</guid>
      <dc:creator>AustinAverill</dc:creator>
      <dc:date>2022-11-29T19:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying unique value definition to account for multiple factors?</title>
      <link>https://community.esri.com/t5/python-questions/modifying-unique-value-definition-to-account-for/m-p/1236118#M66178</link>
      <description>&lt;P&gt;Where is inValue coming from? if its a cursor, then add the GPS_Y_N field and pass that in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def isDuplicate(inValue, gps):
    if all([inValue in uniqueList, gps == 'N']):
        return 1
    else:
        uniqueList.append(inValue)
        return 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If not, use a search cursor and get the value.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 19:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modifying-unique-value-definition-to-account-for/m-p/1236118#M66178</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-29T19:47:31Z</dc:date>
    </item>
  </channel>
</rss>

