<?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: Python script to field calculate one field based on another field's value in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300098#M23232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="82852" data-objecttype="3" href="https://community.esri.com/people/tanana" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;Susan O'Connell&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I think you ment to mark the answer by &lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="44204" data-objecttype="3" href="https://community.esri.com/people/mahtab.gis" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;Mahtab Alam&lt;/A&gt; as helpful, right? Since you marked your own response as helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2015 17:48:23 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2015-02-05T17:48:23Z</dc:date>
    <item>
      <title>Python script to field calculate one field based on another field's value</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300094#M23228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to find a python script to field calculate one field based on another field's value.&amp;nbsp; For example, "Field B" will have a code '23' if "Field A" is equal to CST, or if it is equal to AFF, it will be '11'. Also need to know what to use as a wildcard if CST or AFF is followed by more descriptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 14:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300094#M23228</guid>
      <dc:creator>SusanO_Connell</dc:creator>
      <dc:date>2015-02-05T14:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to field calculate one field based on another field's value</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300095#M23229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will require a code block which is nothing but a python function. Please refer &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004s000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004s000000"&gt;Calculate Field Examples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So all you need is something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def cal( valA):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(valA.startswith('CST') or valA.startswith('AFF')):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and call it as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cal(!Field_A!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:12:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300095#M23229</guid>
      <dc:creator>MahtabAlam1</dc:creator>
      <dc:date>2015-02-05T15:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to field calculate one field based on another field's value</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300096#M23230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Susan O’Connell&lt;/P&gt;&lt;P&gt;Geographic Information Systems&lt;/P&gt;&lt;P&gt;GIS Specialist&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300096#M23230</guid>
      <dc:creator>SusanO_Connell</dc:creator>
      <dc:date>2015-02-05T15:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to field calculate one field based on another field's value</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300097#M23231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/82852"&gt;Susan O'Connell&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your the solution provided by &lt;A href="https://community.esri.com/migrated-users/44204"&gt;Mahtab Alam&lt;/A&gt;‌ solved your problem (and I think it did), could you please mark his answer as the correct one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xander &lt;/P&gt;&lt;P&gt;&lt;EM&gt;GeoNet Moderator&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 17:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300097#M23231</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-05T17:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to field calculate one field based on another field's value</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300098#M23232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="82852" data-objecttype="3" href="https://community.esri.com/people/tanana" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;Susan O'Connell&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I think you ment to mark the answer by &lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="44204" data-objecttype="3" href="https://community.esri.com/people/mahtab.gis" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #287433;"&gt;Mahtab Alam&lt;/A&gt; as helpful, right? Since you marked your own response as helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 17:48:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-field-calculate-one-field-based/m-p/300098#M23232</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-05T17:48:23Z</dc:date>
    </item>
  </channel>
</rss>

