I can't really understand why my code isn't working, see:
import numpy as np
def round2c(x):
for i in x:
for j in i:
if (j >= 0 and j<= 0.33):
j = 0
else:
j = 1
return x
list = [[0.05,0.1,0.4],[0.5,0.5,0.3]]
list2 = round2c(list)
print(list2)
a = np.array([[0.05,0.1,0.4],[0.5,0.5,0.3]])
b = round2c(a)
print(b)
It's neither working with a np.ndarray nor with a list. What am I doing wrong?