i have a 92x92x1 array in numpy, and for every value in this array, if the value is greater than 122, than it should be converted to 255, otherwise it should be converted to 0. Previously i have tried;
new_array=[]
for i in arr:
column=[]
for j in i:
if j>122:
temp=255
else:
temp=0
column.append(j)
new_array.append(column)
new_array=np.resize(np.array(new_array),(92,92,1))
but there must be a quicker, more elegant, and more pythonic way to do this! IS there any other method for mapping these types of functions to 3D arrays?