import arcpy fc = r'< enter pathname to fc, e.g. C:\theGDB.gdb\fcName >' field = '< enter your double field name >' rows = arcpy.SearchCursor(fc) i = 0 index = [] vals = [] for row in rows: val = row.getValue(field) if val != None and val != 0.0: vals.append(val) index.append(i) i = 0 else: i += 1 rows = arcpy.UpdateCursor(fc) j = 1 i = -1 for row in rows: val = row.getValue(field) if val != None and val != 0.0: i+=1 j=1 else: inter = vals + float(j)*((vals[i+1] - vals)/float(index[i+1]+1)) j += 1 row.setValue(field, inter) rows.updateRow(row) del row, rows
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.