IndexError: List Index Out Of Range

4460
2
Jump to solution
04-22-2013 04:27 AM
DamonOsbourne
New Contributor II
What is this error referring to?  The line of code is:

lyr = mapping.ListLayers(mxd,"Burglary",df)[0]
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Damon,

This is usually an indication that the layer does not exist within the MXD.  Try using a wildcard:

lyr = arcpy.mapping.ListLayers(mxd,"Burg*",df)[0]

View solution in original post

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Damon,

This is usually an indication that the layer does not exist within the MXD.  Try using a wildcard:

lyr = arcpy.mapping.ListLayers(mxd,"Burg*",df)[0]
0 Kudos
DamonOsbourne
New Contributor II
The wildcard worked.
0 Kudos