I trying to update the column of a matrix by multiplying it with a float. See the code below.
H = np.array([[1, 2, 3], [4, 5, 6]])
print(H[:, 0] * 0.1)
H[:, 0] = H[:, 0] * 0.1
print(H[:, 0])
Which gives the output:
[0.1 0.4]
[0 0]
Numpy seems to round the float 0.1
to 0
, but only when assigning the value to the column. What is going on here?