Skip to content

Instantly share code, notes, and snippets.

@hallahan
Created November 24, 2013 01:43
Show Gist options
  • Save hallahan/7622346 to your computer and use it in GitHub Desktop.
Save hallahan/7622346 to your computer and use it in GitHub Desktop.
trying to set values iteratively in numpy
import os
import sys
import arcpy
import numpy
import math
from arcpy.sa import *
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
cwd = os.getcwd()
srcPath = cwd + "\\src-img\\"
srcImgs = os.listdir(srcPath)
for img in srcImgs:
path = srcPath + img
arr = arcpy.RasterToNumPyArray(path)
i = 2000
while i < 2100:
j = 2000
while j < 2100:
arr[i][j] = 5
++j
++i
print 'break point'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment