I am trying to produce a set of monthly solar radiation maps based on a monthly parameterization of the diffuse proportion and transmissivity (i.e. new values for both parameters each month). The PointsSolarRadiation function in arcpy produces a full year of monthly radiation values for each function call (i.e. 12 months all based on the same diffuse proportion and transmissivity values). I am trying to extract only the specific month from each of the twelve output files (i.e. extract the "April" data from the file run using the "April" parameters).

To do this I have a subsequent for loop which calls the individual files, identifies the appropriate data column in the file, extracts the data (using SearchCursor) then appends it to the placeholder. The append method fails on the second iteration, which does not happen if I run this with a simpler example of appending defined lists.

My code is as follows:

tableMonthHolder = []
for (j, value) in enumerate(diffuse):
    b = str(j)
    outFeatures = "c:/.../output" + b + ".shp"
    outTableFinder = "T"+b
    tableMonth = [row[0] for row in arcpy.da.SearchCursor(outFeatures,(outTableFinder))]
    tableMonthHolder = tableMonthHolder.append(tableMonth)

Any advice is greatly appreciated.


You are redundantly redefining your variable tableMonthHolder in the last line of code. Try changing this line to:

  • Correct. And list.append returns None, so redefining tableMonthHolder is what blows it up as it lacks a .append method. – Jason Scheirer Jul 2 '13 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.