<?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: Using Python Dictionaries to Change Feature Class Names in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218995#M16848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Joe. As I told Dan, your answers will guide me for the next time I have to work on something similar. In the end I had to do it manually because it was taking me too long to automate it.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2020 20:28:57 GMT</pubDate>
    <dc:creator>NataliaGutierrez1</dc:creator>
    <dc:date>2020-05-06T20:28:57Z</dc:date>
    <item>
      <title>Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218986#M16839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I recently posted a question about python dictionaries and here I am again struggling with them..&lt;/P&gt;&lt;P&gt;I am now trying to use them to change feature class names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem:&lt;/P&gt;&lt;P&gt;I have a list of 77 feature classes and I need to change their names from codes to names using a python dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Feature class name: T14_single_points&lt;/P&gt;&lt;P&gt;New name that I need: Alachua&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not getting any errors when running this code but I am not getting any results either.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# script to change fc name using a dictionary&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\APRX_MXDS\USA_Parcels_2019_Project\test.gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

fc_list &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"points*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# list of fc that end with points&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# dictionary&lt;/SPAN&gt;
county_codes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;14&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Bradford"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Brevard"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;16&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Broward"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fc_list&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# loop through the feature classes&lt;/SPAN&gt;
    key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{[1:3]}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# let the second and third characters in the fc name be the key&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; key &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; county_codes&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
        fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; county_codes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;key&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# assign the value in the dictionary as the new feature class name‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218986#M16839</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2021-12-11T10:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218987#M16840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc_list&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"something is wrong"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"processing stuff"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="string token"&gt;"points*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# list of fc that end with points&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;could be the issue&lt;/P&gt;&lt;TABLE style="color: #4c4c4c; background-color: #ffffff; border: 1px solid #cccccc; font-size: 0.875rem; margin-bottom: 1.55rem;"&gt;&lt;TBODY&gt;&lt;TR style="border-bottom: 1px solid #cccccc;"&gt;&lt;TD style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;DIV class=""&gt;wild_card&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;Limits the results returned. If a value is not specified, all values are returned. The wildcard is not case sensitive.&lt;/P&gt;&lt;H4 class="" style="font-weight: 300; font-size: 1.414rem; margin: 0px 0px 1.55rem;" id="toc-hId-1252724893"&gt;&lt;/H4&gt;&lt;DIV class=""&gt;&lt;TABLE style="background-color: #ffffff; border: 1px solid #cccccc; font-size: 0.875rem; margin-bottom: 1.55rem;"&gt;&lt;THEAD style="background-color: #efefef; border-bottom: 1px solid #cccccc; font-size: 1rem;"&gt;&lt;TR style="border-bottom: none;"&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Symbol&lt;/TH&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Description&lt;/TH&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Example&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY class=""&gt;&lt;TR class="" style="border-bottom: none;"&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;&lt;SPAN class=""&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;Represents zero or more characters.&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;&lt;SPAN class=""&gt;Te*&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;finds Tennessee and Texas.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you mean&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;list of fc that &lt;STRONG&gt;begins&lt;/STRONG&gt; with points&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or did you mean&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;"*points"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;# list of fc that end with points&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in any event that might account for one instance where nothing is processed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218987#M16840</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T10:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218988#M16841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/345701"&gt;Natalia Gutierrez&lt;/A&gt;-&amp;nbsp; to add to&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;'s comments; I don't see you renaming anything, or is that the next stage in your script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218988#M16841</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-04-30T19:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218989#M16842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe, I thought I was renaming in the last line of my script. Line # 15. I guess I am really lost with this one...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218989#M16842</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-04-30T19:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218990#M16843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan that was part of the problem &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218990#M16843</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-04-30T19:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218991#M16844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought that was what you might be thinking.&amp;nbsp; Take a step back and study your code for a minute, and ask yourself, what exactly is fc?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's just a variable and the value of that variable changes as the for loop progresses.&amp;nbsp; Run the snippet of code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fc_list&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
    key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{[1:3]}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; key &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; county_codes&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
        fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; county_codes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;key&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
       &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And when it's done, take a look at your geodatabase and see if names have changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to change the name of the actual feature class, you're going to do a little more work. Take a look&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/rename.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/rename.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Rename—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;and see where that takes you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218991#M16844</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T10:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218992#M16845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/345701"&gt;Natalia Gutierrez&lt;/A&gt;&amp;nbsp; With that part resolved... what now remains?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 20:04:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218992#M16845</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-30T20:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218993#M16846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are looking for the values, not the keys, which could be the other part of the problem.&lt;/P&gt;&lt;P&gt;Examine the example.&amp;nbsp; Dictionaries are designed to be key-driven... your driver is 2 letters from your county names... aka, the values.&amp;nbsp; There is a workaround, if you must stick to dictionaries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;codes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;14&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Bradford"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Brevard"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;16&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Broward"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
kys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; codes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;keys&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
vals &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; codes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;values&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
v &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;v&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; v &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; vals&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

kys  &lt;SPAN class="comment token"&gt;# ---- dict_keys([14, 15, 16])&lt;/SPAN&gt;
vals &lt;SPAN class="comment token"&gt;# ---- dict_values(['Bradford', 'Brevard', 'Broward'])&lt;/SPAN&gt;
v    &lt;SPAN class="comment token"&gt;# ---- ['ra', 're', 'ro']&lt;/SPAN&gt;

look_for &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ra'&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# ---- Let's look for Bradford, ie, 'ra'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; k&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; v &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; codes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;items&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; look_for &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; v&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"found look_for"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"keep looking"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        
found look_for
keep looking
keep looking&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Of course you can skip the dictionary thing and just use nested lists&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;l &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Bradford'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Brevard'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;16&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Broward'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

look_for &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ra'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; k&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; v &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; l&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; look_for &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; v&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"found {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;v&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"keep looking"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        
found Bradford
keep looking
keep looking&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And numpy structured arrays are my preference because slicing is enhanced and the operation can be vectorized on whole inputs columns rather than by row... but I will leave that since I am not sure where you are going with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:41:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218993#M16846</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T10:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218994#M16847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan. In the end I had to do some more research on the topic before I was able to automate this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I needed this very urgent I decided to do it manually since it was taking me to long to automate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using your answer as a guide for the next time I have to do something similar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2020 20:27:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218994#M16847</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-05-06T20:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218995#M16848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Joe. As I told Dan, your answers will guide me for the next time I have to work on something similar. In the end I had to do it manually because it was taking me too long to automate it.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2020 20:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218995#M16848</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-05-06T20:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218996#M16849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry it didn't work out for you;&amp;nbsp;automation can sometimes be a bump in the road.&amp;nbsp; Like anything else though, the more you use it, the better you get at it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2020 20:39:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218996#M16849</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-05-06T20:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python Dictionaries to Change Feature Class Names</title>
      <link>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218997#M16850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes definitely getting a lot better! thanks to you guys in here.&lt;/P&gt;&lt;P&gt;I really appreciate it! I don't know what I would do without your help&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2020 21:21:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-dictionaries-to-change-feature-class/m-p/218997#M16850</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-05-06T21:21:02Z</dc:date>
    </item>
  </channel>
</rss>

