I have an nxnxn matrix which I want to loop over and replace all values < 1E-35 with 1E-35.
for i in range(N):
for j in range(N):
for k in range(N):
if data[i][j][k] < 1E-35:
data[i][j][k] = 1E-35
Doesn't seem to work.
Edit: I worked it out. It was both the indentation and incorrect indexing [i][j][k].
Problem remains: this loops from 0 to N-1 of the NxNxN data? When I do data.min() I still get values ~ 1E-101 which should be 1E-35 after the loop. Am I doing the for loop wrong?
data?