Can someone please explain why we need to do this:df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
instead of just:df = arcpy.mapping.ListDataFrames(mxd, "Layers")
If I just say df = arcpy.mapping.ListDataFrames(mxd)
then I can loop through the df list object by doing something likefor i in df:
print i.name
But if I want to set variable df to a known data frame (in this case "Layers") why do I need to specify the index number [0] at the end of the code line?If anyone can explain this quirk I'd be really grateful. Thanks