I'm using python 2.7.3, when I execute the following piece of code:
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
a = a / float(2**16 - 1)
print a
This will result in he following output:
>> array([[1.52590219e-05, 3.05180438e-05, 4.57770657e-05],
>> [6.10360876e-05, 7.62951095e-05, 9.15541314e-05]])
Exactly as expected, however when I execute the following piece of code:
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
a /= float(2**16 - 1)
print a
I get the following output:
>> array([[0, 0, 0],
>> [0, 0, 0]])
I expected the same output as in the previous example, I don't understand the different ouput, which seems to be a result of using a /= float(2**16 - 1)
vs a = a / float(2**16 - 1)
.