<?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: List Index Out of Range????? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/list-index-out-of-range/m-p/526818#M41266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Never mind found it!!&amp;nbsp; It was I had my shapefile named correctly! But I had the layer named incorrectly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2013 13:51:38 GMT</pubDate>
    <dc:creator>MichelleCouden1</dc:creator>
    <dc:date>2013-05-10T13:51:38Z</dc:date>
    <item>
      <title>List Index Out of Range?????</title>
      <link>https://community.esri.com/t5/python-questions/list-index-out-of-range/m-p/526817#M41265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone tell me what "List Index Out of Range" means??&amp;nbsp; Thanks!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, traceback from arcpy import env&amp;nbsp; mxd = arcpy.mapping.MapDocument("CURRENT")&amp;nbsp; # Join Fields fc = r'K:\TASS\4_MAPPING_DATA_SUPPORT\Traffic_Mapping\Traffic_Count_Data\2011_Counts\2011_Annual_Stations\Annual_Stations_2011.shp' fc2 = r"K:\TASS\2 - GEO-DATA PROCESSING SUPPORT\MICHELLE'S WORK_ENTER NOT!!\Work Folder\Python Programming\Annual_Stations.shp" inFeatures = "Annual_Stations" Table = "AADT"&amp;nbsp; fields_to_join = ['!F2011_TRAF!', '!FLAG!'] arcpy.AddField_management(fc, 'COUNT', 'TEXT') arcpy.CalculateField_management(fc, 'COUNT', 'str(!F2011_TRAF!) + str(!FLAG!)', 'PYTHON')&amp;nbsp; fields_to_join = ['!CURRENT_YE!', '!T_FLAG!'] arcpy.AddField_management(fc2, 'TRAFFIC', 'TEXT') arcpy.CalculateField_management(fc2, 'TRAFFIC', 'str(!CURRENT_YE!) + str(!T_FLAG!)', 'PYTHON')&amp;nbsp; lstLayers = arcpy.mapping.ListLayers(mxd)&amp;nbsp; flayer = arcpy.mapping.ListLayers(mxd, "AADT")[0] alayer = arcpy.mapping.ListLayers(mxd, "Annual_Stations")[0]&amp;nbsp; # Search Joined&amp;nbsp; FRows = arcpy.SearchCursor(flayer) ARows = arcpy.SearchCursor(alayer)&amp;nbsp; ffields = arcpy.ListFields(flayer, "COUNT", "String") afields = arcpy.ListFields(alayer, "TRAFFIC", "String")&amp;nbsp; FList = [] AList = []&amp;nbsp; for row in FRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; Fvalue = row.getValue("COUNT") &amp;nbsp;&amp;nbsp;&amp;nbsp; FList.append(str(Fvalue))&amp;nbsp; for row in ARows: &amp;nbsp;&amp;nbsp;&amp;nbsp; Avalue = row.getValue("TRAFFIC") &amp;nbsp;&amp;nbsp;&amp;nbsp; AList.append(str(Avalue))&amp;nbsp; matched = set(FList) &amp;amp; set(AList)&amp;nbsp; for x in matched: &amp;nbsp;&amp;nbsp;&amp;nbsp; exp = '"TRAFFIC" = ' + "'" + x + "'" &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("Annual_Stations", "ADD_TO_SELECTION", exp) &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("Annual_Stations", "SWITCH_SELECTION") &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 13:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-index-out-of-range/m-p/526817#M41265</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-05-10T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: List Index Out of Range?????</title>
      <link>https://community.esri.com/t5/python-questions/list-index-out-of-range/m-p/526818#M41266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Never mind found it!!&amp;nbsp; It was I had my shapefile named correctly! But I had the layer named incorrectly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 13:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/list-index-out-of-range/m-p/526818#M41266</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-05-10T13:51:38Z</dc:date>
    </item>
  </channel>
</rss>

