sb52191

Appending data to a column with a variable name.

Discussion created by sb52191 on Sep 17, 2013
Latest reply on Sep 18, 2013 by sb52191
Hi,
I have a bunch of rasters showing precipitation data over a long period of time, and I am trying to append the precip values at different geographic points to the attribute table of those points. All is going well until the last step. I am creating new columns based on the precip dates, using a variable in a for loop, but when I go to append the data to the column I get an error, which I almost positive is a result of trying to append using a variable name, instead of the actual name. Anyway, here's the area of interest:

[CODE]
for point in Point_Cursor2:
            x= 0
            result = arcpy.GetCellValue_management(rast, Point_List[x])
           
            date_name= "x" + str(rast)
           
            arcpy.AddField_management("x" + str(rast[2:6]) + "_points.shp", date_name, "DOUBLE")
           
            point.date_name=(result)
            x= x+1
[CODE/]

because "date_name" is not the actual name of the column, it can't append the data to the right place, however I want the date_name to change with every iteration. Any advice?

Thanks,
Scott

Outcomes