1

I'm trying to figure out how to spline specific columns of a shapefile attribute table, but my question is intermediate to this.

How do I select a range of columns, e.g. the 20th column to the right-most column, as fields to apply a for loop operation to?

My first thought was to try numpy, but I'm open to ideas. For now I'd just like to either print the names of the desired columns or specify the columns to be iterated in the for loop line.

import arcpy, numpy as np
from arcpy.sa import *
fieldList = arcpy.ListFields(r"C:\Users\afullhar\Desktop\Lab6\Data For Lab on habitat modeling\Layers\start_data10円_km_Points.shp")
for field in fieldList:
 print format(field.name[19,:])
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Mar 27, 2015 at 20:29

1 Answer 1

6

that's nearly it, but the referencing of the field should be done on the field list, not the field name

fieldList = arcpy.ListFields(r"C:\your.shp")
for field in fieldList[19:]:
 print field.name
answered Mar 27, 2015 at 20:44
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.